Web Automation Test-D3-One of Study Notes (Selenium Eggs-Xpath Usage)

Since the latest version of Firefox no longer supports development tools such as FireBug, you can add extensions such as Firebug by downloading Firefox versions below 49 from https://ftp.mozilla.org/pub/firefox/releases/  .

What is XPath?

XPath is the path language of XML. In layman's terms, it is to find the tag element through the path of the element.

tool

Xpath practice suggests that after installing the Firefox browser, download the plug-in, FireBug.

How to use Xpath

Note: The default dead format is written first //* represents all elements under the positioning page

1. Xpath supports ID, Class, Name positioning functions

2. If the tag does not have the three total attributes of ID, Class and Name, Xpath also supports the attribute positioning function

3. When the attributes of tags are repeated, Xpath provides filtering by tags

4. Xpath provides hierarchical filtering when tabs are repeated

For example: if you can't find your son, then you will find his father first, if you can't, you can look for his grandfather

5. An element's sibling elements are the same as its label, and cannot be located through the hierarchy at this time. Because they are all born to one father, they are twin brothers. Xpath provides index filtering

6. If the above concentration is repeated after use, we can use the ultimate artifact provided by Xpath, logical operation positioning. and or

I usually think of Xpath as a dragon slayer. Martial arts supreme, treasure knife Xpath, Css is out, who will compete with?

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324638960&siteId=291194637