Selenium IDE CSS Element selector

Source: Internet
Author: User

Click the link to join the group "hyatt sharing test Alliance": Https://jq.qq.com/?_wv=1027&k=5FiMKHH
CSS Selector

Find by Node properties

The. class selects all elements of class= "intro".

#id Select all elements of id= "firstname".

* Select All Elements.

Find by node relationship

Element element descendant Selector

Element>element child element Selector

Element+element Brothers and sisters selector

Element1~element2 p~ul, Select each <ul> element that has a <p> element in front of it.

Find by Node properties

[attribute] [target] selects all elements with the target Property.

[attribute=value] [target=_blank] selects all elements of target= "_blank".

[attribute~=value] [title~=flower] Select all elements of the title property that contain the word "flower".

[attribute|=value] [lang|=en] selects all elements with the Lang attribute value beginning with "en".

[attribute^=value] a[src^= "https" selects each <a> element whose src attribute value begins with "https".

[attribute$=value] a[src$= ". pdf" selects all <a> elements whose src attribute ends with ". pdf".

[attribute*=value] a[src*= "abc"] Select each <a> element whose src attribute contains the "abc" substring.

Pseudo class Selector

: Link A:link Select All links.

:checked                             input:checked Select each <input> element that is Selected.

:first-child                          p:first-child      selects each of the first child elements that belong to the parent element <p> Elements.

:last-child                                    p: last-child      selects each <p> element that belongs to the last child element of its parent Element.

: First-of-type P:first-of-type Selects each <p> element that belongs to the first <p> element of its parent Element.

: Last-of-type P:last-of-type Selects each <p> element that belongs to the last <p> element of its parent Element.

:o nly-of-type                     p:only-of-type         Select each <p that belongs to the <p> element that is unique to its parent element > Elements.

:o nly-child                          p:only-child     selects each of the unique child elements that belong to its parent element <p> Elements.

: Nth-child (n) p:nth-child (2) Select each <p> element that belongs to the second child element of its parent Element.

: Nth-last-child (n) p:nth-last-child (2) ibid., starting with the last child element Count.

: Nth-of-type (n) p:nth-of-type (2) Select each <p> element that belongs to the second <p> of its parent Element.

: Nth-last-of-type (n) p:nth-last-of-type (2) ibid., But starts counting from the last child Element.

: Input all <input> elements

: Text all type= "text" <input> elements

:p Assword All <input> elements of type= "password"

: Radio all <input> elements of type= "radio"

: checkbox for all type= "checkbox" <input> elements

: Submit all the <input> elements of type= "submit"

: Reset all type= "reset" <input> elements

: Button all the <input> elements of the type= "button"

: Image all <input> elements of type= "image"

: File all <input> elements of type= "file"


Selenium IDE CSS Element selector

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.