Saturday, January 16, 2016

How to Identify Web Elements Using Firebug

For QA, when you write automation test script you have to know id, name or xpath of web elements.
Below is how I use Firebug to identify.
For example, on website http://cungshopping.com, at "Đăng nhập" form I need to know id/name/xpath of "Mật khẩu" textbox (the green one)

Steps I do as below:
1. Launch Firefox browser and navigation to http://cungshopping.com, click "Đăng nhập" link to navigate to the form that has element you want to know id/name/xpath
2. On menu bar: Tools > Web Developer > Fire bug > Open Firebug
or press F12 to open Firebug window

 The Firebug window open at the bottom as below

3. On Firebug window, click on icon "Click an element in the page to inspect" (the green icon as below)

 4. Then move over on the "Mật khẩu" textbox until the textbox is highlighted in blue color, you will see in the Firebug window the HTML for this element is highlighted too.
So you know the textbox has id="password", name="password". If you want copy any information, you just click on that and "Ctrl +C" to copy.


To copy xpath, on Firebug window, right click on the element --> copy XPath

No comments:

Post a Comment