Selenium XPath Tutorial #8 - Axes Method descendant, descendant-or-self

Поделиться
HTML-код
  • Опубликовано: 11 дек 2024

Комментарии • 10

  • @thangvumanh1320
    @thangvumanh1320 3 года назад +4

    This mentor is the best, his voice is good for me

  • @manoj_mafiosi
    @manoj_mafiosi Год назад +3

    Notes: Selenium XPath Tutorial #8 - Axes Method: `descendant` and `descendant-or-self`
    1. Introduction:
    - These methods are used to select descendants of the context node (current node in the HTML DOM or XML).
    2. Descendant Method:
    - `descendant` selects all descendants (children, grandchildren, etc.) of the context node.
    - Format: `//tagname[@attribute='value']` or `//tagname[*[@attribute='value']]`.
    - Example: `//div[@class='signup-container']//div` selects all `div` elements with class `signup-container` and their descendant `div` elements.
    3. Descendant-or-Self Method:
    - `descendant-or-self` is similar to `descendant` but includes the context node itself.
    - It selects the context node and all its descendants.
    - Format: `//tagname[@attribute='value']/descendant-or-self::tagname[@attribute='value']`.
    - Example: `//div[@class='signup-container']/descendant-or-self::div[@class='promo-regular']` selects the `div` with class `signup-container` and descendant `div` elements with class `promo-regular`.
    4. Customizing XPath:
    - You can omit tag name and use a wildcard `*` for any element with specific attributes.
    - XPath customization requires practice, research, and experimentation with different combinations.
    Conclusion:
    - Understanding `descendant` and `descendant-or-self` axes methods is crucial in XPath.
    - XPath mastery enhances web element identification and automation efficiency.
    - Thank you for watching this tutorial.

    • @riturajaiswal
      @riturajaiswal Год назад

      your format here is wrong bro .......check it up

    • @veganforlife4699
      @veganforlife4699 Год назад

      the correct format
      descendant - //tagname[@attribute='value']//descendant::tagname
      descendant or self - //tagname[@attribute='value']//descendant-or-self::tagname[@attribute='value']

  • @nareshgajula
    @nareshgajula Год назад

    Very good explanation! Great to follow your videos

  • @KrisuParikh
    @KrisuParikh 9 дней назад

    thank you

  • @Undrios
    @Undrios 5 месяцев назад

    thank you sir
    this playlist is very helpful ❤

  • @Rekha_m_angadi
    @Rekha_m_angadi 3 года назад +4

    Hello Sir, i liked your tutorial and the pace in which you are teaching for free..., but i am not understanding the application of learning descendant, ascendant, or self.. pls give relevant examples where we can apply these learnings.
    We only identified in the browser Ctrl F, how are we using it in the test program? pls explain

  • @vikasvicky3024
    @vikasvicky3024 2 года назад

    Where is Salesforce lighting platform in normal developer edition I am unable to select the xpath acess methods

  • @dilawarkhan4085
    @dilawarkhan4085 2 года назад

    Amazing content, i need help
    I successfully navigated to my Web element, got result 1 of 1 but if i click on that element i got Unable to locate element exception, what should i do?