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.

51.

I Am Not Able To Use "style" Attribute To Locate Element With Ie Browser?

Answer»

This is because IE expects ATTRIBUTE values to be in caps while other browsers expect it to be lower case letters. HENCE

//tr[@style="background-color:yellow"] WORKS with other browsers
//tr[@style="BACKGROUND-COLOUR:yellow"] works with IE

This is because IE expects attribute values to be in caps while other browsers expect it to be lower case letters. Hence

//tr[@style="background-color:yellow"] works with other browsers
//tr[@style="BACKGROUND-COLOUR:yellow"] works with IE

52.

What Are Heightened Privileges Browsers?

Answer»

Firefox and IE have browser modes which are not restricted by java script’s same origin policy. These browsers are known as browsers with ELEVATED security privileges. In case of Firefox it is known as CHROME (It’s not the Google browser) and in case of IE it is known as iehta

Firefox and IE have browser modes which are not restricted by java script’s same origin policy. These browsers are known as browsers with elevated security privileges. In case of Firefox it is known as chrome (It’s not the Google browser) and in case of IE it is known as iehta

53.

How Does Selenium Rc Stand With Other Commercial Tools?

Answer»

The biggest advantage of Selenium RC is that it is absolutely free and has vast support of languages and browsers (almost ALWAYS). Selenium LAGS when it COMES to test reporting as Selenium does not have any in built reporting but this can be easily ACHIEVED.

The biggest advantage of Selenium RC is that it is absolutely free and has vast support of languages and browsers (almost always). Selenium lags when it comes to test reporting as Selenium does not have any in built reporting but this can be easily achieved.

54.

I Have Created My Own Firefox Profile; Can I Execute My Test Scripts On It

Answer»

You may like to create your own firefox profile because SELENIUM always created a clean firefox profile while executing the tests and none of your FF settings and plug-in are considered with this clean profile. If you WANT to execute tests on FF with your settings then you should create custom profile for FF.

To be able to execute tests on a custom firefox profile you should specify its PATH while starting Selenium server. For example if your new profile is stored at “awesome location” in your directory then you should start Selenium server as following–

JAVA –jar .jar -firefoxProfileTemplate "awesome location"

You may like to create your own firefox profile because Selenium always created a clean firefox profile while executing the tests and none of your FF settings and plug-in are considered with this clean profile. If you want to execute tests on FF with your settings then you should create custom profile for FF.

To be able to execute tests on a custom firefox profile you should specify its path while starting Selenium server. For example if your new profile is stored at “awesome location” in your directory then you should start Selenium server as following–

Java –jar .jar -firefoxProfileTemplate "awesome location"

55.

What Is Selenium Webdriver?

Answer»

Selenium WebDriver is a tool for WRITING automated tests of websites. It is an API name and aims to MIMIC the behaviour of a real user, and as such interacts with the HTML of the application. Selenium WebDriver is the successor of Selenium Remote CONTROL which has been officially deprecated.

Selenium WebDriver is a tool for writing automated tests of websites. It is an API name and aims to mimic the behaviour of a real user, and as such interacts with the HTML of the application. Selenium WebDriver is the successor of Selenium Remote Control which has been officially deprecated.

56.

What Are The Locators Available In Selenium?

Answer»
  1. ID
  2. NAME
  3. FILTERS
  4. DOM
  5. CSS
  6. XPATH

57.

Is There A Way For Me To Know All Available Options When I Start Selenium Server?

Answer»

If you want to SEE all OPTIONS available while starting Selenium server then you should use option “-h” while starting Selenium server

JAVA –jar .jar –h

It WOULD DISPLAY you all the options which you can use while starting the Selenium server.

If you want to see all options available while starting Selenium server then you should use option “-h” while starting Selenium server

Java –jar .jar –h

It would display you all the options which you can use while starting the Selenium server.

58.

Why Do I Get "permission Denied" Error During Execution Of Selenium Tests?

Answer»

The primary reason of PERMISSION denied error is same origin POLICY restriction from java script. To OVERCOME this error you can use browsers with elevated security PRIVILEGES. In case of Firefox you should use *chrome and in case of IE you should use *iehta as browser for working with Selenium.

The primary reason of permission denied error is same origin policy restriction from java script. To overcome this error you can use browsers with elevated security privileges. In case of Firefox you should use *chrome and in case of IE you should use *iehta as browser for working with Selenium.

59.

What Does Side Stand For?

Answer»

SELENIUM IDE. It was a very TRICKY INTERVIEW QUESTION.

Selenium IDE. It was a very tricky interview question.

60.

What Is The Latest Version Of Selenium?

Answer»

The LATEST VERSIONS are SELENIUM IDE 1.3.0, Selenium Server (formerly the Selenium RC Server) 2.8.0, Selenium Client Drivers Java 2.8.0, Selenium Client Drivers C# 2.8.0, Selenium Client Drivers Ruby 2.8.0, Selenium Client Drivers PYTHON 2.8.1, Selenium Grid 1.0.8.

The latest versions are Selenium IDE 1.3.0, Selenium Server (formerly the Selenium RC Server) 2.8.0, Selenium Client Drivers Java 2.8.0, Selenium Client Drivers C# 2.8.0, Selenium Client Drivers Ruby 2.8.0, Selenium Client Drivers Python 2.8.1, Selenium Grid 1.0.8.

61.

Where To Download Selenium?

Answer»

SELENIUM can be DOWNLOADED and INSTALLED for FREE from seleniumhq.org

Selenium can be downloaded and installed for free from seleniumhq.org

62.

How Much Does Selenium License Cost Per Client Machine?

Answer»

SELENIUM is open source software, released under the Apache 2.0 LICENSE and can be downloaded and USED without CHARGE.

Selenium is open source software, released under the Apache 2.0 license and can be downloaded and used without charge.

63.

What Is The Price Of Selenium License Per Server?

Answer»

Selenium is open source SOFTWARE, released under the Apache 2.0 LICENSE and can be downloaded and USED WITHOUT CHARGE.

Selenium is open source software, released under the Apache 2.0 license and can be downloaded and used without charge.

64.

What Test Can Selenium Do?

Answer»

Selenium COULD be USED for the functional, regression, load testing of the web based applications. The automation tool could be implemented for post release validation with continuous INTEGRATION tools like Jenkins, Hudson, QuickBuild or CruiseControl.

Selenium could be used for the functional, regression, load testing of the web based applications. The automation tool could be implemented for post release validation with continuous integration tools like Jenkins, Hudson, QuickBuild or CruiseControl.

65.

Describe Technical Problems That You Had With Selenium Tool?

Answer»

As with any other type of test automation tools like SilkTest, HP QTP, Watir, Canoo Webtest, Selenium ALLOWS to record, edit, and debug tests cases. However there are several problems that seriously affect maintainability of recorded test cases, OCCASIONALLY Quality Assurance Engineers complain that it takes more TIME to maintain automated test cases than to perform manual testing; however this is an issue with all automated testing tools and most likely related to improper testing framework design. Another problem is COMPLEX ID for an HTML element. If IDS is auto-generated, the recorder test cases may fail during playback. The work around is to use XPath to find required HTML element. Selenium supports AJAX without problems, but QA Tester should be aware that Selenium does not know when AJAX action is completed, so ClickAndWait will not work. Instead QA tester could use pause, but the snowballing effect of several 'pause' commands would really slow down total testing time of test cases. The best solution would be to use waitForElement.

As with any other type of test automation tools like SilkTest, HP QTP, Watir, Canoo Webtest, Selenium allows to record, edit, and debug tests cases. However there are several problems that seriously affect maintainability of recorded test cases, occasionally Quality Assurance Engineers complain that it takes more time to maintain automated test cases than to perform manual testing; however this is an issue with all automated testing tools and most likely related to improper testing framework design. Another problem is complex ID for an HTML element. If IDs is auto-generated, the recorder test cases may fail during playback. The work around is to use XPath to find required HTML element. Selenium supports AJAX without problems, but QA Tester should be aware that Selenium does not know when AJAX action is completed, so ClickAndWait will not work. Instead QA tester could use pause, but the snowballing effect of several 'pause' commands would really slow down total testing time of test cases. The best solution would be to use waitForElement.

66.

What Are The Steps To Run Automation Using Selenium?

Answer»

The very basic steps are:

  1. Record the TEST steps USING selenium-IDE.
  2. Modify the script according to the testing needs. Add VALIDATION POINTS, JAVA Scripts, Time-out etc.
  3. Run the test.
  4. View the result after test run complete analyze.

The very basic steps are:

67.

What Is The Selenium's Recording Language?

Answer»

SELENIUM’s RECORDING LANGUAGE is “HTML”.

Selenium’s recording language is “HTML”.

68.

How To Run Test Case Recorded Using Selenium Ide In Other Browsers?

Answer»

RUNNING TEST case recorded with the help of Selenium REMOTE Control.

Running test case recorded with the help of Selenium Remote Control.

69.

But My Tests Need Me To Exercise Objects Outside Browser, How Do I Achieve It?

Answer»

You can use Robot CLASS in java to ACHIEVE this, but it WOULD be dirty solution even if you GET through this.

You can use Robot class in java to achieve this, but it would be dirty solution even if you get through this.

70.

How To Start The Selenium Server From Your Language Class?

Answer»

ANSWER : TRY { seleniumServer = NEW SeleniumServer(); seleniumServer.start(); } catch (EXCEPTION e) { e.printStackTrace(); }

71.

Can Selenium Test An Application On Android Browser?

Answer»

SELENIUM can HANDLE ANDROID BROWSER.

Selenium can handle Android browser.

72.

Selenium Test A Application On Iphone Mobile Safari Browser?

Answer»

SELENIUM can HANDLE Mobile Safari BROWSER. There is experimental Selenium IPHONE Driver for running tests on Mobile with Safari on the iPhone and iPad and IPOD Touch.

Selenium can handle Mobile Safari browser. There is experimental Selenium IPhone Driver for running tests on Mobile with Safari on the iPhone and iPad and iPod Touch.

73.

What Is Selenium Ide?

Answer»

Selenium IDE is an INTEGRATED development environment for Selenium tests. It is IMPLEMENTED as a Firefox extension, and has a recording feature, which will keep account of user actions as they are performed and store them as a reusable script to play back. Selenium-IDE also offers full editing of TEST CASES for more PRECISION and control.

Selenium IDE is an integrated development environment for Selenium tests. It is implemented as a Firefox extension, and has a recording feature, which will keep account of user actions as they are performed and store them as a reusable script to play back. Selenium-IDE also offers full editing of test cases for more precision and control.

74.

What Are The Advantages And Disadvantages Of Selenium ?

Answer»

ADVANTAGES

  • Supports C#, Java, PHP, Perl, Python
  • Supported on Windows, Linux and Mac OS
  • Highly active developer community - backed by Google
  • Powerful methods to locate elements (Xpath, CSS, DOM)

Disadvantages

  • Challenges running on BROWSERS other than Firefox
  • Difficulty to automate AJAX
  • LIMITATIONS to automate Applets, MS and Desktop Applications

Advantages

Disadvantages

75.

Explain Selenium Waitfor Commands ?

Answer»
  • waitForPageToLoad : This command will make the script to WAIT till the page loads.Syntax is waitForPageToLoad(TIMEOUT); Timed out is the maximum TIME the script will wait for the page to load.
  • waitForAlert : This command will wait for the alert message to appear
  • waitForTable: This command will wait for the Web table to completely load in the page
  • waitForTitle: This command will for the page Title to appear on the browser.
  • Other waitFor COMMANDS : Selenium has several other wait command like waitForText,waitForPopup and so on. These commands are generically called Synchronization commands

76.

What Are The Assertion Statements In Selenium ?

Answer»
  • assertTextPresent : This will assert if the text is present in the page.
  • assertText: This will assert if a particular ELEMENT is having the particular text.
  • assertTitle: This will assert if the page is having a PROPER TITLE.
  • assertValue: This will assert if a Text BOX or check box has a particular value
  • assertElementPresent: This will assert if a particular UI Element is present in the page.

77.

What Are The Running Options In Selenium ?

Answer»
  • Run a Test Case: Click the Run button to run the currently displayed test case.
  • Run a Test Suite: Click the Run All button to run all the test cases in the currently loaded test suite.
  • Stop and Start: The Pause button can be used to stop the test case while it is running. The icon of this button then changes to indicate the Resume button. To continue click Resume.
  • Stop in the Middle: Set a BREAKPOINT in the test case to cause it to stop on a particular command. This is useful for debugging your test case. To set a breakpoint, SELECT a command, right-click, and from the context MENU select Toggle Breakpoint.
  • Start from the Middle: We can set the IDE to begin running from a specific command in the middle of the test case. This also is used for debugging. To set a start point, select a command, right-click, and from the context menu select Set/Clear Start Point.
  • Run Any Single Command: Double-click any single command to run it by itself. This is useful when writing a single command. It lets you IMMEDIATELY test a command you are constructing, when you are not sure if it is correct. You can double-click it to see if it runs CORRECTLY. This is also available from the context menu.

 

 

78.

What Is Test Runner ?

Answer»

Test Runner allows you to run the test CASE in a BROWSER loaded with the Selenium-Core TestRunner. Test runner is invoked by CLICKING the below SHOWN button in the IDE.

Test Runner allows you to run the test case in a browser loaded with the Selenium-Core TestRunner. Test runner is invoked by clicking the below Shown button in the IDE.

79.

What Are The Selenese Commands In Selenium ?

Answer»
  • clicking a link - click or clickAndWait commands
  • entering values - type command
  • SELECTING OPTIONS from a drop-down listbox - select command
  • clicking checkboxes or RADIO buttons - click command

80.

Explain About Selenium-grid ?

Answer»

Selenium-Grid allows the Selenium-RC SOLUTION to scale for test suites or test suites to be run in multiple environments.

With Selenium-Grid multiple instances of Selenium-RC are running on various operating system and browser configurations, each of these when launching register with a hub. When tests are SENT to the hub they are then redirected to an available Selenium-RC, which will launch the browser and run the test.

This allows for running tests in parallel, with the entire test suite THEORETICALLY taking only as long to run as the longest INDIVIDUAL test.

Selenium-Grid allows the Selenium-RC solution to scale for test suites or test suites to be run in multiple environments.

With Selenium-Grid multiple instances of Selenium-RC are running on various operating system and browser configurations, each of these when launching register with a hub. When tests are sent to the hub they are then redirected to an available Selenium-RC, which will launch the browser and run the test.

This allows for running tests in parallel, with the entire test suite theoretically taking only as long to run as the longest individual test.

81.

What Is Selenium-rc (remote Control) ?

Answer»

Selenium-RC provides an API (Application Programming Interface) and library for each of its supported LANGUAGES: HTML, Java, C#, Perl, PHP, Python, and Ruby. Selenium-RC allows the test automation developer to USE a programming language for maximum FLEXIBILITY and extensibility in developing test logic.

For instance, if the application under test returns a result SET, and if the automated test program needs to run tests on each element in the result set, the programming languages iteration support can be used to iterate through the result set, calling Selenium commands to run tests on each item.

Selenium-RC provides an API (Application Programming Interface) and library for each of its supported languages: HTML, Java, C#, Perl, PHP, Python, and Ruby. Selenium-RC allows the test automation developer to use a programming language for maximum flexibility and extensibility in developing test logic.

For instance, if the application under test returns a result set, and if the automated test program needs to run tests on each element in the result set, the programming languages iteration support can be used to iterate through the result set, calling Selenium commands to run tests on each item.

82.

What Are The Features Of Selenium Ide ?

Answer»
  • Record and PLAYBACK
  • Intelligent field selection will use IDs, NAMES, or XPath as needed
  • Auto complete for all common SELENIUM commands
  • Walk through test cases and test suites.
  • Debug and set breakpoints
  • Save texts as HTML, Ruby scripts, or other formats
  • Support for Selenium user-extensions.js file
  • Option to AUTOMATICALLY ASSERT the title of every page
  • Rollup common commands

 

 

83.

Explain About Selenium-ide ?

Answer»
  • Selenium IDE is an integrated development environment for Selenium tests.
  • Operates as a Firefox add-on and PROVIDES an interface for developing and running individual test cases or ENTIRE test suites.
  • Selenium-IDE has a RECORDING feature, which will keep account of user actions as they are performed and store them as a reusable script to play back.
  • It also has a context MENU (right-click) integrated with the Firefox browser, which allows the user to pick from a list of assertions and verifications for the selected location.
  • Offers full editing of test cases.
  • Although it is a Firefox only add-on, tests created in it can also be run against other browsers by using Selenium-RC & specifying the name of the test suite on the command LINE.

84.

What Are The Components Of Selenium ?

Answer»
  1. SELENIUM IDE
  2. Selenium REMOTE CONTROL
  3. Selenium GRID

85.

Why And When To Automate?

Answer»
  • Frequent regression testing
  • Repeated test case Execution is REQUIRED
  • User Acceptance Tests
  • Faster FEEDBACK to the developers
  • REDUCE the Human Effort
  • Test same application on multiple ENVIRONMENTS

86.

What Is Selenium ?

Answer»
  • Selenium is a portable software testing framework for web applications.
  • The tests can be written as HTML tables or coded in a number of popular programming languages and can be run directly in most modern web browsers.
  • Selenium operations are highly flexible, ALLOWING many OPTIONS for locating UI elements and comparing EXPECTED test results against ACTUAL application behavior.
  • Selenium can be deployed on Windows, Linux, and Macintosh.
  • Selenium is used for UAT (User Acceptance Test)

87.

How Do You Capture An Element Loading After The Page Load?

Answer»

provide a time to CHECK the ELEMENT( in seconds) Like :

public void waitForElementPresent(String element, int timeout) throws Exception { for (int second = 0;; second++) { if (second >= timeout) FAIL("Timeout.Unable to find the Specified element"+element); try { if (selenium.isElementPresent(element)) break; } catch (Exception E) { } Thread.sleep(1000); } }

provide a time to check the element( in seconds) Like :

88.

How Do You Verify An Object Presented In Multiple Pages?

Answer»

CHECK on each PAGE

assertTrue(selenium.isElementPresent(LOCATOR));

Check on each page