This article mainly on the Selenium2 Web element positioning and XPath writing examples, please refer to the friends to discuss together. If there are deficiencies, please the great god, thank you!
Through the Firefox browser plug-in Firebug + XPath checker, combined with three examples to illustrate the implementation of page element positioning and XPath path writing. Let's start with our WEB page element positioning tour ...
First, start the Firefox browser and start the Firebug plugin (press F12 button)
First, Baidu search box positioning (element ID)
URL input http://www.baidu.com/Enter Baidu, click the button, and the mouse to locate the Baidu search box after the click, the interface as shown:
Second, Yixun login user name location (XPath relative path)
Third, Yixun add shopping cart after the DIV layer {go to Checkout} button positioning (XPath absolute path)
SELENIUM2 Learning -002-selenium2 Web element positioning and XPath writing demo example