Creating Selenium tests you often will find yourself fiddling around with (hopefully not too complex) XPaths. If you are having Firebug installed you can use one of its lesser known features to speed up working with XPaths.
Little example ?
Open up Firebug for this page, select the Console tab and enter the following command into the Firebug command line:
$x(“/html/body/div[2]/div/h1”)
Result:
[h1]
Note: Hover the mouse over the h1 and you will see the corresponding element highlighted in the page.
Even better – to have a look at the inner HTML of the headline element enter:
$x(“/html/body/div[2]/div/h1”)[0].innerHTML
Pingback: Selenium Locator Tips « JodieM.com.au