Explore topic-wise InterviewSolutions in .

This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.

1.

Did You Write Any User Extensions?

Answer»

User extensions are stored in a separate file that we will tell Selenium IDE or Selenium RC to use. Inside there the new function will be WRITTEN in JavaScript.

Because Selenium CORE is developed in JavaScript, creating an EXTENSION follows the standard rules for prototypal languages. To create an extension, we create a function in the following design pattern.

Selenium.prototype.doFunctionName = function(){
.
}

The "do" in front of the function name TELLS Selenium that this function can be called as a command for a STEP instead of an internal or private function.

User extensions are stored in a separate file that we will tell Selenium IDE or Selenium RC to use. Inside there the new function will be written in JavaScript.

Because Selenium core is developed in JavaScript, creating an extension follows the standard rules for prototypal languages. To create an extension, we create a function in the following design pattern.

Selenium.prototype.doFunctionName = function(){
.
}

The "do" in front of the function name tells Selenium that this function can be called as a command for a step instead of an internal or private function.

2.

Give Selenium Ide Tool Disadvantage?

Answer»

3.

In Selenium Ide, Give The Usage Of Context Menu?

Answer»

It PERMITS user to select from ASSERTIONS and VERIFICATIONS list for chosen SPECIFIC location.

It permits user to select from assertions and verifications list for chosen specific location.

4.

Give Major Components Of Selenium Testing Tools?

Answer»

5.

Give The Default Port Number Of Selenium Server?

Answer»

4444

4444

6.

How Recorded Command Can Be Edited In Ide?

Answer»

FIRST SELECT and CHOOSE INTERESTED VALUE from drop-down.

First select and choose interested value from drop-down.

7.

Give Ide's Main Parts And Components?

Answer»

8.

How To Run Test Case Traced By Employing Ide In Browsers?

Answer»

SELENIUM REMOTE CONTROL is USED in this CASE.

Selenium remote control is used in this case.

9.

Define Selenium Test Suite And How It Is Developed?

Answer»

The main CONCEPT of software testing is to GROUP test cases as test SUITE. HTML files CONTAINING LINKS of test cases in selenium. To run test suite, selenium IDE plug-in called Test runner is used.

The main concept of software testing is to group test cases as test suite. HTML files containing links of test cases in selenium. To run test suite, selenium IDE plug-in called Test runner is used.

10.

Give The Steps For Running Automation Using Selenium?

Answer»

The BASIC steps are given below:

  • Record TEST steps by making use of selenium-IDE
  • Change the script according to the requirements of testing. Add java scripts, validation points, Time-out, etc.
  • Now, RUN test
  • Result can be VIEWED after analyzing test run

 

The basic steps are given below:

 

11.

My Application Uses Ajax Heavily How Do I Use Selenium Rc To Work With Ajax Operations?

Answer»

Ajax operations don’t RELOAD a page like normal form submission but they MAKE http requests behind the scene. You cannot use waitForPageToLoad for such operations and instead should use conditional wait for change in state of application. This could as well mean waiting for presence of an element before continuing with test operations. Consider FOLLOWING example in which type operation triggers Ajax operation which is followed by conditional wait for presence of a text box

// type operation BRINGS element “q” on screen without loading the page

selenium.type("elementLocator","testData"); // conditional wait for element “q” for(intsecond = 0;; second++) { if(second >= 60) FAIL("timeout"); try {if(selenium.isElementPresent("q"))break;}catch(Exception e){} Thread.sleep(1000); }

Ajax operations don’t reload a page like normal form submission but they make http requests behind the scene. You cannot use waitForPageToLoad for such operations and instead should use conditional wait for change in state of application. This could as well mean waiting for presence of an element before continuing with test operations. Consider following example in which type operation triggers Ajax operation which is followed by conditional wait for presence of a text box

// type operation brings element “q” on screen without loading the page

12.

From Where, You Can Download Selenium?

Answer»

INITIALLY, VISIT official SITE of SELENIUM to GET information about it. Different version can be downloaded from official site.

Initially, visit official site of Selenium to get information about it. Different version can be downloaded from official site.

13.

What Is Needed To Be Good At Selenium?

Answer»

HTML basic knowledge, web technologies and web BASED testing are mandatory. Other SOFTWARE development languages are not NEEDED. It is better to have knowledge on JAVA script.

HTML basic knowledge, web technologies and web based testing are mandatory. Other software development languages are not needed. It is better to have knowledge on JAVA script.

14.

Define Selenium 2.x?

Answer»

It is the NEXT generation SELENIUM. It is selenium server-web driver that REPLACES Selenium RC.

It is the next generation selenium. It is selenium server-web driver that replaces Selenium RC.

15.

How To Insert A Breakpoint In Selenium Ide?

Answer»

Break point can be set in two WAYS in Selenium IDE

  1. Right click on the COMMAND in Selenium IDE and select "Toggle BreakPoint"
  2. Select the command in Selenium IDE and press "B" key on the keyboard
  3. If you want to clear the break point once again SPRESS "B" key on the keyboard
  4. You can set multiple break POINTS in Selenium IDE

Break point can be set in two ways in Selenium IDE

16.

Which Two Commands Can Be Used To Check That An Alert With A Particular Message Popped Up?

Answer»

The following COMMANDS are available within Selenium for processing Alerts:

  • getAlert()
  • assertAlert()
  • assertAlertNotPresent()
  • assertAlertPresent()
  • storeAlert()
  • storeAlertPresent()
  • verifyAlert()
  • verifyAlertNotPresent()
  • verifyAlertPresent()
  • waitForAlert()
  • waitForAlertNotPresent()
  • waitForAlertPresent()

The AlertPresent() and AlertNotPresent() functions check for the existence or not of an alert – regardless of it’s content. The Alert() functions ALLOW the CALLER to specify a pattern which should be matched. The getAlert() method also exists in Selenium RC, and returns the text from the PREVIOUS Alert displayed.

SELENIUM IDE INTERVIEW Questions and Answers

The following commands are available within Selenium for processing Alerts:

The AlertPresent() and AlertNotPresent() functions check for the existence or not of an alert – regardless of it’s content. The Alert() functions allow the caller to specify a pattern which should be matched. The getAlert() method also exists in Selenium RC, and returns the text from the previous Alert displayed.

SELENIUM IDE Interview Questions and Answers

17.

Which Selenium Command(s) Simulates Selecting A Link?

Answer»

CLICK, clickandWait, ClickAt, ClickAtandWait, DOUBLECLICK, DoubleClickandWait, doubleClickAt,
doubleClickAtandWait

click, clickandWait, ClickAt, ClickAtandWait, DoubleClick, DoubleClickandWait, doubleClickAt,
doubleClickAtandWait

18.

If One Wanted To Display The Value Of A Variable Named Answer In The Log File, What Would The First Argument To The Previous Command Look Like?

Answer»

ECHO()

echo()

19.

What Selenese Command Can Be Used To Display The Value Of A Variable In The Log File, Which Can Be Very Valuable For Debugging?

Answer»

ECHO()

echo()

20.

How Would One Access A Selenium Variable Named "count" From Within A Javascript Snippet?

Answer»

${COUNT}

${count}

21.

Which Wildcards Does Side Support?

Answer»

*, [ ]

*, [ ]

22.

What Does A Character Class For All Alphabetic Characters And Digits Look Like In Globbing?

Answer»

[0-9] MATCHES any DIGIT
[a-zA-Z0-9] matches any ALPHANUMERIC CHARACTER
[a-zA-Z] matches any ALPHABET character

[0-9] matches any digit
[a-zA-Z0-9] matches any alphanumeric character
[a-zA-Z] matches any alphabet character

23.

What Does A Character Class For All Alphabetic Characters And Digits Look Like In Regular Expressions?

Answer»

[0-9] MATCHES any DIGIT
[A-Za-z0-9] matches any ALPHANUMERIC CHARACTER
[A-Za-z] matches any ALPHABET character

[0-9] matches any digit
[A-Za-z0-9] matches any alphanumeric character
[A-Za-z] matches any alphabet character

24.

What Is The Globbing Sequence That Loosely Translates To Anything Or Nothing?

Answer»

(*) which TRANSLATES to “match ANYTHING,” i.e., NOTHING, a single character, or many CHARACTERS.

(*) which translates to “match anything,” i.e., nothing, a single character, or many characters.

25.

What Is The Regular Expression Sequence That Loosely Translates To "anything Or Nothing?"

Answer»

(.* i.e., dot STAR) This two-CHARACTER SEQUENCE can be translated as “0 or more occurrences of any character” or more SIMPLY, “anything or NOTHING.

(.* i.e., dot star) This two-character sequence can be translated as “0 or more occurrences of any character” or more simply, “anything or nothing.

26.

If A Selenium Function Requires A Pattern Argument, What Five Prefixes Might That Argument Have?

Answer»

GLOB, REGEXP, EXACT, regexpi

glob, regexp, exact, regexpi

27.

If A Selenium Function Requires A Script Argument, What Would That Argument Look Like In General Terms?

Answer»

StoreEval(SCRIPT, VARIABLE) and storeExpression(EXPRESSION, variableName)

StoreEval(script, variable) and storeExpression(expression, variableName)

28.

What Is The Difference Between An Assert And A Verify With Selenium Commands?

Answer»

EFFECTIVELY an “ASSERT” will fail the test and abort the CURRENT test CASE, WHEREAS a “verify” will fail the test and continue to run the test case.

Effectively an “assert” will fail the test and abort the current test case, whereas a “verify” will fail the test and continue to run the test case.

29.

What Is Difference Between Borland Silk Test And Selenium?

Answer»

Selenium is completely free TEST AUTOMATION tool, while SILK Test is not. Only web applications can be testing using Selenium testing suite. However, Silk Test can be used for testing client SERVER applications. Selenium supports FOLLOWING web browsers: Internet Explorer, Firefox, Safari, Opera or Konqueror on Windows, Mac OS X and Linux. However, Silk Test is limited to Internet Explorer and Firefox.

Silk Test uses 4Test scripting language. However, Selenium test suite has the flexibility to use many languages like Java, .Net, Perl, PHP, Python, and Ruby.

Selenium is completely free test automation tool, while Silk Test is not. Only web applications can be testing using Selenium testing suite. However, Silk Test can be used for testing client server applications. Selenium supports following web browsers: Internet Explorer, Firefox, Safari, Opera or Konqueror on Windows, Mac OS X and Linux. However, Silk Test is limited to Internet Explorer and Firefox.

Silk Test uses 4Test scripting language. However, Selenium test suite has the flexibility to use many languages like Java, .Net, Perl, PHP, Python, and Ruby.

30.

What Is Difference Between Qtp And Selenium?

Answer»

Only web applications can be testing using Selenium testing SUITE. HOWEVER, QTP can be used for testing client server applications. Selenium supports following web browsers: Internet Explorer, Firefox, Safari, Opera or Konqueror on Windows, Mac OS X and Linux. However, QTP is limited to Internet Explorer on Windows.

QTP uses scripting language implemented on top of VB Script. However, Selenium test suite has the flexibility to use many languages like JAVA, .Net, Perl, PHP, Python, and RUBY.

Only web applications can be testing using Selenium testing suite. However, QTP can be used for testing client server applications. Selenium supports following web browsers: Internet Explorer, Firefox, Safari, Opera or Konqueror on Windows, Mac OS X and Linux. However, QTP is limited to Internet Explorer on Windows.

QTP uses scripting language implemented on top of VB Script. However, Selenium test suite has the flexibility to use many languages like Java, .Net, Perl, PHP, Python, and Ruby.

31.

What Are The Advantages And Disadvantages Of Using Selenium As Testing Tool?

Answer»

Advantages: FREE, SIMPLE and powerful DOM (document object model) level testing, can be used for continuous integration; GREAT fit with Agile projects.

Disadvantages: Tricky setup; dreary errors diagnosis; can not test CLIENT SERVER applications.

Advantages: Free, Simple and powerful DOM (document object model) level testing, can be used for continuous integration; great fit with Agile projects.

Disadvantages: Tricky setup; dreary errors diagnosis; can not test client server applications.

32.

What Programming Languages Can You Use In Selenium Rc?

Answer»

C#, Java, PERL, PHP, PYTHON, Ruby

C#, Java, Perl, PHP, Python, Ruby

33.

What Browsers Are Supported By Selenium Remote Control?

Answer»

The TEST automation EXPERT can use Firefox, IE 7/8, SAFARI and OPERA browsers to run tests in Selenium REMOTE Control.

The test automation expert can use Firefox, IE 7/8, Safari and Opera browsers to run tests in Selenium Remote Control.

34.

What Is The Cost Of Selenium Test Suite?

Answer»

Selenium test suite a set of open SOURCE SOFTWARE tool, it is FREE of cost.

Selenium test suite a set of open source software tool, it is free of cost.

35.

What You Say About The Flexibility Of Selenium Test Suite?

Answer»

Selenium TESTING suite is HIGHLY flexible. There are multiple ways to add functionality to Selenium framework to customize test automation. As compared to other test automation tools, it is Selenium’s strongest CHARACTERISTIC. Selenium Remote Control support for multiple programming and scripting languages allows the test automation engineer to build any logic they need into their automated testing and to use a preferred programming or scripting language of one’s choice.

ALSO, the Selenium testing suite is an open SOURCE project where code can be modified and enhancements can be submitted for contribution.

Selenium testing suite is highly flexible. There are multiple ways to add functionality to Selenium framework to customize test automation. As compared to other test automation tools, it is Selenium’s strongest characteristic. Selenium Remote Control support for multiple programming and scripting languages allows the test automation engineer to build any logic they need into their automated testing and to use a preferred programming or scripting language of one’s choice.

Also, the Selenium testing suite is an open source project where code can be modified and enhancements can be submitted for contribution.

36.

What Is The Difference Between Single And Double Slash In Xpath?

Answer»

/

  1. START selection from the document node
  2. ALLOWS you to create 'absolute' PATH expressions
  3. example “/html/body/p” matches all the paragraph ELEMENTS

//

  1. start selection matching anywhere in the docume
  2. allows you to create 'relative' path expressions
  3. example. “//p” matches all the paragraph elements

 

/

//

 

37.

How Do I Upload A File Using Selenium? I Need To Upload A Word File During Test Execution.

Answer»

If you are USING Firefox then you can use “type” COMMAND to type in a FILE Input box of upload file. But type operation does not work with IE and you would have to use “Robot” class in java to work MAKE file upload work.

If you are using Firefox then you can use “type” command to type in a File Input box of upload file. But type operation does not work with IE and you would have to use “Robot” class in java to work make file upload work.

38.

What Are The Disadvantage Of Selenium Ide Tool?

Answer»
  1. SELENIUM IDE tool can only be USED in MOZILLA FIREFOX browser.
  2. It is not PLAYING multiple windows when we record it.

39.

What Are The Advantage And Features Of Selenium Ide?

Answer»
  1. Intelligent field selection will use IDs, names, or XPath as NEEDED
  2. It is a record & PLAYBACK tool and the script FORMAT can be written in various languages including C#, Java, PERL, Python, PHP, HTML
  3. Auto complete for all common Selenium commands
  4. Debug and set breakpoints
  5. OPTION to automatically assert the title of every page
  6. Support for Selenium user-extensions.js file

 

 

40.

How Do You Select The 2nd Item In A List Box Or Drop Down?

Answer»

selenium.SELECT(selectLocator, optionLocator)
selectLocator – a LOCATOR for the select ELEMENT
optionLocator – a locator for the OPTION element

selenium.select(selectLocator, optionLocator)
selectLocator – a locator for the select element
optionLocator – a locator for the option element

41.

What Is The Use Of Context Menu In Selenium Ide?

Answer»

It ALLOWS the USER to PICK from a LIST of assertions and verifications for the SELECTED location.

It allows the user to pick from a list of assertions and verifications for the selected location.

42.

While Trying To Execute My Tests With Firefox I Encountered Following Error "firefox Refused Shutdown While Preparing A Profile". How Do I Solve It?

Answer»

This message simply MEANS that SELENIUM is not able to launch FF browser as it is ALREADY running on your system. To overcome this you should CLOSE all running instances of FF browser.

You should also check your system process if there is any hidden FF profile running which is not visible on screen. You should kill all FF processes and following this your tests should run smooth

This message simply means that Selenium is not able to launch FF browser as it is already running on your system. To overcome this you should close all running instances of FF browser.

You should also check your system process if there is any hidden FF profile running which is not visible on screen. You should kill all FF processes and following this your tests should run smooth

43.

How Can I Learn To Automate Testing Using Selenium?

Answer»

Don't be surprised if the interviewer ASKS you to describe the approach for learning Selenium. This interviewer WANTS to hear how you can innovative SOFTWARE test automation process the company. Most likely they are looking for software professional with a good Selenium experience, who can do Selenium training for team MEMBERS and get the team started with test automation. I hope this Selenium tutorial will be helpful in the preparation for this Selenium INTERVIEW question.

Don't be surprised if the interviewer asks you to describe the approach for learning Selenium. This interviewer wants to hear how you can innovative software test automation process the company. Most likely they are looking for software professional with a good Selenium experience, who can do Selenium training for team members and get the team started with test automation. I hope this Selenium tutorial will be helpful in the preparation for this Selenium interview question.

44.

How To Test Ajax Application With Selenium?

Answer»

Ajax INTERVIEW questions COULD be tough for NEWBIE in the test automation, but will be easily cracked by Selenium Tester with a relevant experience. Read the detailed approach at Testing Ajax applications with Selenium in the right way

Ajax interview questions could be tough for newbie in the test automation, but will be easily cracked by Selenium Tester with a relevant experience. Read the detailed approach at Testing Ajax applications with Selenium in the right way

45.

Compare Hp Qtp Vs Selenium?

Answer»

When QA team considers acquiring test automation to assist in testing, one of the most CRITICAL decisions is what technologies or tools to use to automate the testing. The most obvious APPROACH will be to look to the SOFTWARE market and evaluate a few test automation tools. Read SELENIUM vs QTP comparison

When QA team considers acquiring test automation to assist in testing, one of the most critical decisions is what technologies or tools to use to automate the testing. The most obvious approach will be to look to the software market and evaluate a few test automation tools. Read Selenium vs QTP comparison

46.

Do You Know Any Alternative Test Automation Tools For Selenium?

Answer»

Selenium appears to be the mainstream open source tool for BROWSER side testing, but there are many alternatives. Canoo Webtest is a great Selenium ALTERNATIVE and it is probably the fastest automation tool. Another Selenium alternative is Watir, but in order to use Watir QA Tester has to learn Ruby. One more alternative to Selenium is Sahi, but is has CONFUSING interface and small developers community.

Selenium appears to be the mainstream open source tool for browser side testing, but there are many alternatives. Canoo Webtest is a great Selenium alternative and it is probably the fastest automation tool. Another Selenium alternative is Watir, but in order to use Watir QA Tester has to learn Ruby. One more alternative to Selenium is Sahi, but is has confusing interface and small developers community.

47.

Have You Read Any Good Books On Selenium?

Answer»

There are several great books COVERING Selenium AUTOMATION tool, you COULD check the review at Best Selenium Books: Top Recommended PAGE.

There are several great books covering Selenium automation tool, you could check the review at Best Selenium Books: Top Recommended page.

48.

What Programming Language Is Best For Writing Selenium Tests?

Answer»

The WEB applications may be written in Java, Ruby, PHP, Python or any other web framework. There are certain ADVANTAGES for using the same language for writing TEST cases as application under test. For example, if the team already have the experience with Java, QA Tester could always get the piece of advice while mastering Selenium test cases in Java. Sometimes it is better to choose simple programming language that will ultimately deliver better success. In this case QA testers can adopt easier programming languages, for example Ruby, MUCH FASTER comparing with Java, and can become become experts as soon as possible.

The web applications may be written in Java, Ruby, PHP, Python or any other web framework. There are certain advantages for using the same language for writing test cases as application under test. For example, if the team already have the experience with Java, QA Tester could always get the piece of advice while mastering Selenium test cases in Java. Sometimes it is better to choose simple programming language that will ultimately deliver better success. In this case QA testers can adopt easier programming languages, for example Ruby, much faster comparing with Java, and can become become experts as soon as possible.

49.

How To Developer Selenium Test Cases?

Answer»

Using the Selenium IDE, QA Tester can record a test to comprehend the syntax of Selenium IDE commands, or to check the basic syntax for a SPECIFIC type of user interface. Keep in mind that Selenium IDE recorder is not clever as QA Testers WANT it to be. Quality assurance team should never consider Selenium IDE as a "record, save, and run it" tool, all the time anticipate REWORKING a recorded test cases to make them maintainable in the future.

Using the Selenium IDE, QA Tester can record a test to comprehend the syntax of Selenium IDE commands, or to check the basic syntax for a specific type of user interface. Keep in mind that Selenium IDE recorder is not clever as QA Testers want it to be. Quality assurance team should never consider Selenium IDE as a "record, save, and run it" tool, all the time anticipate reworking a recorded test cases to make them maintainable in the future.

50.

How Many Testing Framework Can Qa Tester Use In Selenium Rc?

Answer»

Testing frameworks aren't required, but they can be HELPFUL if QA Tester wants to automate test cases. Selenium RC supports BROMINE, JUnit, NUnit, RSpec (Ruby), Test::Unit (Ruby), TestNG (JAVA), UNITTEST (Python).

Testing frameworks aren't required, but they can be helpful if QA Tester wants to automate test cases. Selenium RC supports Bromine, JUnit, NUnit, RSpec (Ruby), Test::Unit (Ruby), TestNG (Java), unittest (Python).