SELENIUM2 Learning -002-selenium2 Web element positioning and XPath writing demo example

Source: Internet
Author: User
Tags xpath

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.