Thursday 29 May 2014

Identifying Elements using Firebug

In selenium, the driver recognizes various elements in a webpage and performs actions on them. To identify the elements on the web page we can use Firebug.
Identification of correct GUI elements is a prerequisite to create an automation script.  

Prerequisites 
1)    Firefox browser (Preferably) / Chrome Browser
2)    Fire Bug Lite



 Steps for finding elements in Firebug

3)    Download Firebug lite from  http://getfirebug.com/downloads
4)    Right Click on the screen and you will see a option “Inspect Element with Firebug”
 





5)    A new panel will open at the bottom of the screen.


64)    Click on the icon to get focus on the element.


7)    Move the mouse over to the element for which you want selenium to recognise.



8)    There are several ways selenium can recognize the element.
a)   Id
b)   Name
c)    Link Text
d)   Xpath
e)   DOM


9)    For Xpath, you can click on the “Firepath” tab in firebug and directly get the xpath



10) While taking the xpath for writing the script in selenium, omit the 1st “.” Before the xpath.

No comments:

Post a Comment