Translate

Selenium IDE

1)  What is Selenium IDE ?
A)  Selenium IDE (Integrated Development Environment) is an ideal tool used to develop selenium test scripts... It is the only flavor of selenium which allows us to record user actions on browser window... Here, the scripts are recorded in 'Selenese'(a set of selenium commands like Click, assertTextPresent, storeText, etc,.).. It is not only a time-saver but also an excellent way of learning Selenium scripts syntax... It is a Firefox add-0n...
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)  How do you open/start selenium-ide after installation ?
A)  First launch/open firefox browser and then click on 'Tools' tab in the menu bar.. You can see an option called 'selenium ide' , click on it, a small window will be opened where you can start recording scripts...

4)  Features of selenium IDE..
A)  click here for detailed 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..
5)  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..
6)  What are the selenium locators and what is the tool you  use to identify element ?
A)  Selenium locators are the way of finding HTML element on the page to perform Selenium actions... We use firebug(for firefox) to identify elements as it is more popular and powerful web development tool.. It inspects HTML and modify style and layout in real-time.. We can edit, debug and monitor CSS, HTML and Javascript live in any web page.. ((click here to download firebug))
-->For Internet Explorer we can choose debugbar.. It views HTML DOM tree, we can view and edit tab attributes.. 
((click here to download debugbar))

7)  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..
8)  What is selenese ?
A)  Selenium set of commands that run our test is called Selenese.. A sequence of these commands is a test script.. There are three types of selenese..
  1. Actions : They perform some operations like clicking a link or typing text in text box or selecting an option from drop-down box etc..
  2. 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'..
  3. Accessors : Checks the state of application and store the results in a variable.. Ex: storeText, storeTitle, etc..

9)  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..
--> 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'..
13)  How do you export tests from Selenium IDE to RC ?
A)  First i will open the test in IDE, which should be exported to RC.. There after i'l select 'File' from the menu bar.. when we mouseover on 'Export Test Case As' in the file menu, we could see different languages like C#, Java, Python and Ruby.. Select the language you want to export your test and provide the name to save it..