Software Testing-Element positioning

Source: Internet
Author: User

Video Address (third lesson): https://pan.baidu.com/s/1gfLVC2n

Element positioning

Selenium supported positioning methods:

ID, Name,xpath,dom,link,css,jquery,tag.   (We usually use an ID or name). When there is no ID, we can assign an ID to the element by assign the ID to element keyword.

Note: Sometimes you need to go into a frame or an IFRAME and then locate an element, we need to use two keywords,

Enter a frame or iframe:sleect frame | Locator

Back to top frame or iframe:unselect frame

Xpath:xpath is a language for finding information in an XML document. XPath is used to navigate through elements and attributes in an XML document.

Learn more about XPath: http://www.w3school.com.cn/xpath/index.asp

XPath positioning methods: Absolute positioning, relative positioning, index positioning, attribute value positioning, attribute name positioning, partial attribute value positioning, used to match any attributes and elements.

Find an address to practice the practice is almost!

Software Testing-Element positioning

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.