1) What is Selenium IDE ?
The Selenium IDE is basically something having record & playback options & also has very good user interface. The core part of Selenium IDE is based on JavaScript & also supports different extension in it. Along with record & playback, you can use Selenium IDE for multiple dynamic stuffs. The main limitation of Selenium IDE is that, it supported in only Firefox browser. If you want to execute your scripts on different browsers, then you can use Selenium RC (Selenium Remote Control). The Selenium RC supports multiple browsers like IE, Firefox, Chrome, Safari, Opera etc.
2) How to install Selenium IDE ?
I use seleniumhq.org site to download any software regarding selenium.. Here, if we click on the version number of selenium ide it starts downloading the add-ons, just we have to click on 'install now' button and restart the firefox browser.. With-in 5 minutes we can install selenium ide...
3) Features of selenium IDE..
- Its main feature is record and playback..
- Debugging features by setting breakpoints, startpoints, pause..
- Identifies element using id, name, xpath etc..
- Auto complete for all common selenium commands..
- It has an option of asserting title of every page automatically..
- Support for selenium user-extensions.js file..
- Option to run single test or multiple tests(suite).
- It has a feature of exporting testcase/suite into different formats like C#, Java, Ruby, Python..
4) Advantages and disadvantages of selenium IDE..
A) Advantages :
- Freeware..
- Easy to install..
- It is the only flavor of selenium that allows us to record user actions on browser window..
- Scripts recorded in IDE can be coverted into other languages like Java, C#, Python and Ruby..
- It is not only a time saver but also an excellent way of learning scripts syntax..
- We can insert comments in the middle of the script for better understanding and debugging..
- Context menu, which allows us to pick from a list of assertions and verifications for the selected location..
Disadvantages:
- Main disadvantage of IDE is that it runs only in firefox browser..
- Selenium IDE can execute scripts created in selenese only.
- Cannot upload files..
- It does not directly support loops and conditions..
- Reading from external files like .txt, .xls is not possible..
5) How do you locate elements in IDE ?
A) I will focus on the unique attribute values like id, name or other structural information that is stable enough to withstand frequent changes to the web application.. I strongly recommend CSS selectors as locating strategy.. They are considerably faster than xpath and can find the most complicated objects in any HTML document..
6) What is selenese ?
There are three types of selenese..
- Actions : They perform some operations like clicking a link or typing text in text box or selecting an option from drop-down box etc..
- Assertions : They verify that the state of application conforms to what is expected.. Ex: 'verify that this checkbox is checked', 'make sure that the page title is X'..
- Accessors : Checks the state of application and store the results in a variable.. Ex: storeText, storeTitle, etc..
How do you add check points or verification points ?
A) They are called as Assertions in selenium.. 'assert', 'verify' and 'waitFor' are the commands used to add check points..
Ex: assertText, verifyElementPresent, waitForTextPresent, etc..
10) Name some commands that you use frequently in IDE ?
A) Open, click, type, select, assertText, assertTitle, assertTextPresent, verifyText, verifyTextPresent, veriftTitle, waitForText, waitForTextPresent, waitForTitle, store, storeText, storeTitle, check, uncheck, pause, mouseover, etc..
11) What is the difference between assert and verify ?
A) When an 'assert' fails, the test is aborted where as when 'verify' fails, the test will continue execution logging the failure..
'assert' is used when the expected value is mandatory to continue with next set of steps.. However 'verify' is used when the expected value is optional to continue with the next set of steps..
12) Difference between waitFor and pause commands ?
A) 'waitFor' command waits for some condition to become true..
For example, 'waitForPageToLoad(20000)'-- it will wait upto 20 thousand milliseconds to load required page.. If the page is loaded before 20,000ms then it jumps to next step to execute.. If the page is not loaded before 20,000ms then it stops the execution due to time-out error..
A) They are called as Assertions in selenium.. 'assert', 'verify' and 'waitFor' are the commands used to add check points..
Ex: assertText, verifyElementPresent, waitForTextPresent, etc..
10) Name some commands that you use frequently in IDE ?
A) Open, click, type, select, assertText, assertTitle, assertTextPresent, verifyText, verifyTextPresent, veriftTitle, waitForText, waitForTextPresent, waitForTitle, store, storeText, storeTitle, check, uncheck, pause, mouseover, etc..
11) What is the difference between assert and verify ?
A) When an 'assert' fails, the test is aborted where as when 'verify' fails, the test will continue execution logging the failure..
'assert' is used when the expected value is mandatory to continue with next set of steps.. However 'verify' is used when the expected value is optional to continue with the next set of steps..
12) Difference between waitFor and pause commands ?
A) 'waitFor' command waits for some condition to become true..
For example, 'waitForPageToLoad(20000)'-- it will wait upto 20 thousand milliseconds to load required page.. If the page is loaded before 20,000ms then it jumps to next step to execute.. If the page is not loaded before 20,000ms then it stops the execution due to time-out error..
Pause command stops the execution of the test until the specified time..
Ex: pause(10000)-- It stops the execution of test for 1o thousand milliseconds.. After completing 10,000ms it jumps to next command to execute.. I prefer 'waitFor' command than 'pause'..
