HomeAutomation

Selenium Java Interview Questions And Answers – Part 7

Selenium Java Interview Questions And Answers – Part 7

Selenium Java Interview Questions and Answers Part-7

1) Explain how you can insert a break point in Selenium IDE?

There are two methods to set breakpoints:
– In the first method,
Right click on the command and select the ‘Toggle Breakpoint’. You can also use shortcut key “B” from the keyboard.
You can set a breakpoint just before the Test Case you want to examine.
After setting breakpoints, click on the Run button to run the test case from the start to the breakpoint.
Repeat the same step to deselect the Breakpoint.
– In the second method,
Select Menu Bar -> ‘Actions’ -> select the Toggle Breakpoint. To deselect repeat the same step.

2) Explain how you can debug the tests in Selenium IDE?

Tests could be debugged by following below steps:
– insert a break point from the location from where you want to execute test step by step
– run the test case
– test case execution will be paused at the given break point
– click on the blue button to continue with the next statement
– to continue executing all the commands at a time click on the “Run” button

3) What are the limitations of Selenium IDE?

– Not suitable for testing extensive data.
– Incapable of handling multiple windows.
– Connections with the database can not be tested.
– Cannot handle the dynamic part of web-based applications.
– Does not support capturing of screenshots on test failures.
– No feature available for generating result reports.

4) What are the two modes of views in Selenium IDE?

Either Selenium IDE can be opened as a pop up window or in side bar

5) In Selenium IDE, what are the element locators that can be used to locate the elements on web page?

– ID
– Name
– Link Text
– CSS Selector
– DOM
– XPATH

6) How can you convert any Selenium IDE tests from Selenese to other other language?

Script can be exported to other programming languages. To change the script format, open “Options” menu, select “Format” command, and then choose one of these programming languages from the menu.

7) Using Selenium IDE, is it possible to get data from a particular HTML table cell?

Verifytext can be used to verify text exist within the table.

8) In Selenium IDE, explain how you can execute a single line?

It can be executed in 2 ways:
– Right click on the command in Selenium IDE and select “Execute This Command”.
– Select the command in Selenium IDE and press “X” key on the keyboard.

9) In which format does the source view show the script in Selenium IDE?

Script is displayed in HTML format

10) Explain, how you can insert a start point in Selenium IDE?

We can insert a start point in the following ways:

– Right click on the command where the start point has to be set and select ‘Set/Clear Start Point’.
– Select the particular command and press ‘s’ or ‘S’ (shortcut key) for the same.

11) What are regular expressions and how you can use them in Selenium IDE?

A regular expression is a sequence of characters that define a search pattern. Usually such patterns are used by string searching algorithms for “find” or “find and replace” operations on strings, or for input validation.
Regular expressions can be used to match different content types on a web page – Links, elements and text.

12) What are core extensions in Selenium IDE?

There are 3 core extensions in Selenium IDE:

– Action: It commands Selenium IDE to perform an action i.e. accessing UI (User Interface) on the web page.
– Assertion: It defines the verifications to be done on the data received from UI after running some commands.
– Location Strategy: It defines a strategy to locate a web element on the Web Page. It could be by name, ID, CSS, tag, XPath, etc.

13) How you will handle switching between multiple windows in Selenium IDE?

The selectWindow | tab=x and selectWindow | title=y commands switch between browser tabs. You can use it with title=(title of tab to be selected) or, often easier, use tab= with number of the tab (e. g 0,1,2,…).
selectWindow | TAB=OPEN | https://newwebsiteURL.com  – this opens a new tab and loads the website with the given URL.

14) How you will verify the specific position of an Web Element in Selenium IDE?

Selenium IDE indicates the position of an element by measuring (in pixels) how far it is from the left or top edge of the browser window using the below commands:
verifyElementPositionLeft – verifies if the specified number of pixels match the distance of the element from the left edge of the page.
verifyElementPositionTop – verifies if the specified number of pixels match the distance of the element from the top edge of the page.

15) How you will retrieve the message in an Alert box in Selenium IDE?

We can use the storeAlert command to retrieve the alert message and store it in a variable.

16) Why Selenium RC is preferred over Selenium IDE?

Selenium RC can run tests on multiple browsers but IDE can run tests only in Firefox browser.

17) What is the difference between Selenium RC and Selenium WebDriver?

– WebDriver’s architecture is simpler than Selenium RC’s.
– WebDriver is faster than Selenium RC since it speaks directly to the browser and uses the browser’s own engine to control it.
– WebDriver interacts with page elements in a more realistic way when compared to RC.
– WebDriver’s API is simpler than Selenium RC’s. It does not contain redundant and confusing commands.
– WebDriver can support the headless HtmlUnit browser but RC does not support it.

18) Which language is used in Selenium IDE?

Selenese is the language used to write Selenium Commands.

19) What are Accessors in Selenium IDE?

Accessors are the selenium commands that examine the state of the application and store the results in variables. They are also used to automatically generate Assertions.
Some of the most commonly used Accessors commands include:
– storeTitle: This command gets the title of the current page
– storeText: This command gets the text of an element
– storeValue: This command gets the (whitespace-trimmed) value of an input field
– storeTable: This command gets the text from a cell of a table
– storeLocation: This command gets the absolute URL of the current page
– storeElementIndex: This command gets the relative index of an element to its parent
– storeBodyText: This command gets the entire text of the page
– storeAllButtons: It returns the IDs of all buttons on the page
– storeAllFields: It returns the IDs of all input fields on the page
– storeAllLinks: It returns the IDs of all links on the page

20) Can I control the speed and pause the test executed in Selenium IDE?

We can control the speed of the test by using the set speed command. The pause command is a simple wait command and useful to delay the execution of the automated testing for the specified time.

21) Where do I see the results of Test Execution in Selenium IDE?

Select File -> Export test case results to save result in html report

22) Where do I see the description of commands used in Selenium IDE?

The Reference Pane shows a concise description of the currently selected Selenese command in the Editor. It also shows the description about the locator and value to be used on that command.

23) Can I build test suite using Selenium IDE?

Yes. Selenium IDE can be used to build test suites.

24) What verification points are available in Selenium IDE?

Given below are the mostly used verification commands that help us check if a particular step has passed or failed.
– verifyElementPresent
– assertElementPresent
– verifyElementNotPresent
– assertElementNotPresent
– verifyText
– assertText
– verifyAttribute
– assertAttribute
– verifyChecked
– assertChecked
– verifyAlert
– assertAlert
– verifyTitle
– assertTitle

25) How to set a global base URL for every test case of one test suite file in Selenium IDE?

Set an Environment variable to store the base URL and use it in every test case.

Next Steps:

> More interview questions and answers on Selenium Java, continue to the next post (Click on Next Post link below)

> Check complete Selenium Java interview questions and answers here (Click here)

Please leave your questions/comments/feedback below.

Happy Learning ?

About Me > Bijan Patel

Connect to me on Linked In (Click here)

On a mission to contribute to the Software Testing Community in all possible ways.

Comments (0)

Leave a Reply

Your email address will not be published. Required fields are marked *