1) How to open Selenium IDE in Firefox?
A) Selenium IDE can be opened in two different ways,
- In side bar from View menu -> Side bar -> Selenium IDE
- As a pop up window from Tools menu -> Selenium IDE.
While using Selenium IDE in browser side bar it cannot record user operations in a pop up window opened by application.
2) Is it possible to control speed of execution in Selenium IDE?
A) Yes, it is possible to control the speed of execution in Selenium IDE. In Actions menu there are options like Fastest, Faster, Slowest and Slower, helps to control speed of the execution. Apart from that in IDE provides a slider with Slow and Fast pointers to control the speed of execution.
3) Where do I see the results of Test Execution in Selenium IDE?
A) Selenium IDE displays result of test execution in Log Tab at the bottom of the tool.
4) Where do I see the description of commands used in Selenium IDE?
A) Selenium IDE displays description of used commands in reference tab at the bottom of the tool. The simplest way to see the description of the command which we used is just click on the command, by default Reference tab opens with an explanation of the command which is clicked.
5) Is it possible to Create Test Suite in Selenium IDE?
A) Yes, it is possible to create a test suite in Selenium IDE. You have to create individual test cases and add them to suite. Follow the below steps to create Tes suite in Selenium IDE.
Open Selenium IDE,
A) Yes, Selenium IDE contains checkpoints; these are also named as assertions. These checkpoints can be added either during recording or after recording. The checkpoints are classified in three different ways.
A) It is very simple to add checkpoints to the test cases during recording
A) It’s very easy to edit tests in IDE. IDE supports two different types of edit modes for modifying existing tests.
A) Exactly, we don’t have anything like format to write coding; we need to follow three basic steps to complete a line of code IDE. After entering data in the following blocks, it’s a notification of finished one line code.
A) In the Target block, we describe object, which helps IDE to identify the object and performs the action according to the command with value.
11) How do we describe object and from where we take description?
A) When ever we are opening any webpage (www.google.com), internet downloads that page code from server and keeps in page source. Page source will be in the form of XHTML format. We dig the page source and take the description of the object. According to the description of the object, IDE go backs to page source and pickups the object while executing
Ex: The following code is Google Search input box
<input id="gbqfq" class="gbqfif" name="q" type="text" autocomplete="off" value="" style="border: none; padding: 0px; margin: 0px; height: auto; width: 100%; background-image: url(data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw%3D%3D); background-color: transparent; position: absolute; z-index: 6; left: 0px; outline: none; background-position: initial initial; background-repeat: initial initial;" dir="ltr" spellcheck="false">
In the above code, we have properties like name, id, class all these are the properties of input box. To write data into Google Search input box, we use id = gbqfq or class = gbqfif or name = q in target block.
12) How many different methods we use to identify object?
A) There are ‘N’ no of ways we recognize object from page source like
A) Xpath stands for Extensive Markup Language path, when even any HTML, XHTML, DHTML or XML is creating or generating, we take help of defined tags (predefined or user defined). We use predefined tags in HTML’s to create web pages and user defined tags to create XML files. HTML or XML, the code will be generated in terms of parent Child format. Whenever we need to identify any object, where the name of the object is not unique, id is temporary, class name is repeating, we took the help of xpath. With of help of Xpath we identify the object based on the nodes.
2) Is it possible to control speed of execution in Selenium IDE?
A) Yes, it is possible to control the speed of execution in Selenium IDE. In Actions menu there are options like Fastest, Faster, Slowest and Slower, helps to control speed of the execution. Apart from that in IDE provides a slider with Slow and Fast pointers to control the speed of execution.
3) Where do I see the results of Test Execution in Selenium IDE?
A) Selenium IDE displays result of test execution in Log Tab at the bottom of the tool.
4) Where do I see the description of commands used in Selenium IDE?
A) Selenium IDE displays description of used commands in reference tab at the bottom of the tool. The simplest way to see the description of the command which we used is just click on the command, by default Reference tab opens with an explanation of the command which is clicked.
5) Is it possible to Create Test Suite in Selenium IDE?
A) Yes, it is possible to create a test suite in Selenium IDE. You have to create individual test cases and add them to suite. Follow the below steps to create Tes suite in Selenium IDE.
Open Selenium IDE,
- Select File -> Save Test Case with TestCase1.html Name, Record the test steps and Save
- Select File -> New Test Case with TestCase2.html Name, Record the test steps and Save
- Select File -> New Test Case with TestCase3.html Name, Record the test steps and Save
- Select File -> Save Test Suite and Provide name as ‘Test-Suite’ as Name. Now a new test suite is created with the name Test-Suite. Going forward Click on open Test Suite in file menu to open saved test suite.
A) Yes, Selenium IDE contains checkpoints; these are also named as assertions. These checkpoints can be added either during recording or after recording. The checkpoints are classified in three different ways.
- Verify: Verify is used for validate expected value on application at specified position with actual value to verify existence. If actual and expect value matches, IDE executes next lines in test cases. If actual and expected are not matching IDE waits till the default timeout (30000 ms) and gives the failure notice and continues execution. For every failure in execution failure count will increase.
- Assert: Assert is used to verify existence of actual value in application from expected information. If actual and expected value is not correct/ mismatches, it gives failure notice and stops executing further lines in the test case. In Log tab, it gives detail information such as what is actual value and what is expected. For every failure in execution failure count will increase.
- waitFor: waitFor is also same as verify Command, but the difference between waitFor and verify is, verify can be used for all kinds of controls in the application but most of the waitFor commands are used for Ajax Controls. If waitFor command fails at verification point, execution controller goes to next test case without stopping the execution. For every failure in execution failure count will increase.
A) It is very simple to add checkpoints to the test cases during recording
- During Recording: At the point where checkpoint need to add go to the application, right click on the mouse and click on show all available commands at the bottom of the right click operations, it will display list of Assert, verify and WaitFor checkpoints, choose the one which you expect at that position and click on it. It adds a line of code in selenium IDE
- After recording: If any checkpoint need to add after recording, place the cursor next to the position line and click on right click from mouse and select “Insert new command” by default a new blank line will add to the code before cursor positioned line. Enter/ select checkpoint name in command list, add target value [target means object which need to verify] and enter expected value in Value.
A) It’s very easy to edit tests in IDE. IDE supports two different types of edit modes for modifying existing tests.
- Table View: In Table view, we need to click on the line where modification is required, onclick the line; displays the used command, target and value separately in Command, target and value blocks. Rephrase the existing text/command in three different blocks.
- Source View: In this view the test case will be in the format of XHTML, we need to add html code. We has to write one <TR> and three <TD> lines to add a new line in the test case. For editing identify the <TR> row and change the text in between <TD>.
A) Exactly, we don’t have anything like format to write coding; we need to follow three basic steps to complete a line of code IDE. After entering data in the following blocks, it’s a notification of finished one line code.
- Name of Command
- Element Locator (also known as Target)
- Value (required when using echo, wait etc)
A) In the Target block, we describe object, which helps IDE to identify the object and performs the action according to the command with value.
11) How do we describe object and from where we take description?
A) When ever we are opening any webpage (www.google.com), internet downloads that page code from server and keeps in page source. Page source will be in the form of XHTML format. We dig the page source and take the description of the object. According to the description of the object, IDE go backs to page source and pickups the object while executing
Ex: The following code is Google Search input box
<input id="gbqfq" class="gbqfif" name="q" type="text" autocomplete="off" value="" style="border: none; padding: 0px; margin: 0px; height: auto; width: 100%; background-image: url(data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw%3D%3D); background-color: transparent; position: absolute; z-index: 6; left: 0px; outline: none; background-position: initial initial; background-repeat: initial initial;" dir="ltr" spellcheck="false">
In the above code, we have properties like name, id, class all these are the properties of input box. To write data into Google Search input box, we use id = gbqfq or class = gbqfif or name = q in target block.
12) How many different methods we use to identify object?
A) There are ‘N’ no of ways we recognize object from page source like
- Id = idname
- Name = Name of Object
- ClassName = ClassName of Object
- Link = name of Link
- Xpath = location of the object
- Css selector = according to style design
A) Xpath stands for Extensive Markup Language path, when even any HTML, XHTML, DHTML or XML is creating or generating, we take help of defined tags (predefined or user defined). We use predefined tags in HTML’s to create web pages and user defined tags to create XML files. HTML or XML, the code will be generated in terms of parent Child format. Whenever we need to identify any object, where the name of the object is not unique, id is temporary, class name is repeating, we took the help of xpath. With of help of Xpath we identify the object based on the nodes.
Examples:
- //input[@name= ‘Name Value’]
- //input[@id= ‘ID value’]
- //input[@class= ‘Class Name’]
- //input[contains(@id, ‘Partial Id’)]
A) CSS (Cascading Style Sheets) is a language for describing the rendering of HTML and XML documents. CSS uses Selectors for binding style properties to elements in the document. These Selectors can be used by Selenium as another locating strategy.
<html>
<body>
<form id="loginForm">
<input class="required" name="username" type="text" />
<input class="required passfield" name="password" type="password" />
<input name="continue" type="submit" value="Login" />
<input name="continue" type="button" value="Clear" />
</form>
</body>
</html>
- css=form#loginForm (3)
- css=input[name="username"] (4)
- css=input.required[type="text"] (4)
- css=input.passfield (5)
- css=#loginForm input[type="button"] (4)
- css=#loginForm input:nth-child(2) (5)
15) If Selenium contains too many ways to identify Object? Which method needs to use?
A) We have an option to validate the existence of Alert using verifyAlert /AssertAlert on the page. To perform action on that alert window, we need to use selenium2.
17) During recoding in Selenium IDE, if the Target method recorded with ID. How can change the Target value from ID to Name?
A) Its very simple, click on the line and see the same target info in targer block at the bottom, change the target name form id to Name and change the value accordingly.
18) How do I test my own element locator in IDE?
A) When ever you are writing any new element locator place it in Target block and click on find button next to it. It will highlight that object in application, if it’s not the correct locator it shows error information in log window.
19) What is the scripting language using by Selenium IDE?
A) Selenese is the language which is used by IDE as a scripting language.
20) Is it possible to convert IDE tests into another language tests?
A) Yes, it is possible to convert IDE tests to N-unit, J-unit 3/4, TestNG, Ruby, Phyton2 languages using Export Test Case As in File menu.
21) How do I execute the converted test cases using selenium IDE?
A) No, it’s not possible to execute the converted test cases in selenium IDE, IF you converted test case to java need to use selenium2 with Eclipse, converted to .net need to use VS with selenium2, converted to ruby need to use ruby with selenium. Every conversion has its own separate editors and interfaces for execution
22) If I add a line of code in the middle of the list, how to I test that line without testing from beginning?
A) Its very easy, double click on the line which you had added, If that object is existing on the browser, it performs that task on the application on an instant.
23) Is it possible to start execution from a specific line in IDE?
A) Yes, it is possible to start execution of the IDE test from the specific line. Select the line from where the script needs to start execute, right click on the line and click Set/ Clear Start point. Set and clear works as on and off operations.
24) Is it possible to stop execution of script at specific line in IDE?
A) Yes, it’s possible to stop execution of scripts at specific line, select the line where script need to stop execution, right click on that line and add toggle break point.
25) Can I use both starting and ending points within the script?
A) Yes, we can use both Set/ Clear method and Toggle break method in one test case.
26) Do we have any specific tools, which help to identify element locators easily?
A) Yes, we have an add-on to Firefox named as “Fire path”, which helps you to locate elements easily. But my suggestion is dig the application and create your own element locator.
- If the object has constant id, we use id method
- if the object has constant name, we use name method
- if the object has link, we use link name
- if the above options are not working, we take help from XPath
A) We have an option to validate the existence of Alert using verifyAlert /AssertAlert on the page. To perform action on that alert window, we need to use selenium2.
17) During recoding in Selenium IDE, if the Target method recorded with ID. How can change the Target value from ID to Name?
A) Its very simple, click on the line and see the same target info in targer block at the bottom, change the target name form id to Name and change the value accordingly.
18) How do I test my own element locator in IDE?
A) When ever you are writing any new element locator place it in Target block and click on find button next to it. It will highlight that object in application, if it’s not the correct locator it shows error information in log window.
19) What is the scripting language using by Selenium IDE?
A) Selenese is the language which is used by IDE as a scripting language.
20) Is it possible to convert IDE tests into another language tests?
A) Yes, it is possible to convert IDE tests to N-unit, J-unit 3/4, TestNG, Ruby, Phyton2 languages using Export Test Case As in File menu.
21) How do I execute the converted test cases using selenium IDE?
A) No, it’s not possible to execute the converted test cases in selenium IDE, IF you converted test case to java need to use selenium2 with Eclipse, converted to .net need to use VS with selenium2, converted to ruby need to use ruby with selenium. Every conversion has its own separate editors and interfaces for execution
22) If I add a line of code in the middle of the list, how to I test that line without testing from beginning?
A) Its very easy, double click on the line which you had added, If that object is existing on the browser, it performs that task on the application on an instant.
23) Is it possible to start execution from a specific line in IDE?
A) Yes, it is possible to start execution of the IDE test from the specific line. Select the line from where the script needs to start execute, right click on the line and click Set/ Clear Start point. Set and clear works as on and off operations.
24) Is it possible to stop execution of script at specific line in IDE?
A) Yes, it’s possible to stop execution of scripts at specific line, select the line where script need to stop execution, right click on that line and add toggle break point.
25) Can I use both starting and ending points within the script?
A) Yes, we can use both Set/ Clear method and Toggle break method in one test case.
26) Do we have any specific tools, which help to identify element locators easily?
A) Yes, we have an add-on to Firefox named as “Fire path”, which helps you to locate elements easily. But my suggestion is dig the application and create your own element locator.
No comments:
Post a Comment