What is Shadow DOM? | How to identify shadow root elements using Selenium 4 | GetShadowRoot method

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

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

  • @manishr1000-w8i
    @manishr1000-w8i 2 месяца назад +1

    Excellent Content. Just to add on to this topic that I found an easier way to write all the lengthy shadow root code. Following are steps:
    1)In Development Tool (F12) window> Right click the element> Copy> Copy JSPath.
    2) It will provide fullJSPath of the webelement.
    3) On chatgpt (or any AI platform) > paste above jspath > and enter the prompt: "You have above jspath. You have to select this webelement in Selenium4 using shadowhost and shadowroot approach"
    4) It will provide almost exact code required for shadow-root hierarchy.
    Above approach can reduce most of the manual time required otherwise in identifying sub-elements one by one

  • @ajaykrishna1136
    @ajaykrishna1136 8 месяцев назад +4

    Do we have other way to identify element directly instead of traversing from top to bottom ? Identifying element with this approach is a tedious task.

    • @maximumautomation
      @maximumautomation  8 месяцев назад +1

      As far as I know, this is the only option in webdriver to get the shadow elements.

  • @TheSuspectRustopia
    @TheSuspectRustopia 2 года назад +1

    I have been looking for an explanation like this, thank you very much, you did a great job

  • @narendrar9030
    @narendrar9030 Год назад +1

    nice explanation understood the concept well.

  • @ОтацТорпедије
    @ОтацТорпедије Год назад +1

    A great explanation indeed sir .

  • @yuriytereshchuk1232
    @yuriytereshchuk1232 Год назад +1

    Thanks for the detailed explanation. It is really helpful.

  • @MrBiz00ka
    @MrBiz00ka Год назад +1

    Nice explanation made excellent by nice speech pattern with pauses. Great job.

  • @osnicirio4986
    @osnicirio4986 11 месяцев назад +2

    A great explanation. Thank you

  • @ChayaE-yw8tm
    @ChayaE-yw8tm 2 месяца назад +1

    great explanation

  • @CynthiaKaufman-c7j
    @CynthiaKaufman-c7j 2 месяца назад +1

    You’re a legend!

  • @olasupoabdlateef4294
    @olasupoabdlateef4294 5 месяцев назад +1

    This is really helpful. Thanks

  • @julianpatino6622
    @julianpatino6622 10 месяцев назад +1

    It was pretty useful for me.

  • @sreedharSN-ft8fm
    @sreedharSN-ft8fm Год назад +1

    Great Video ... why we need to use only css selector to identify shadow root inside shadow tree (why it will throw invalid locator exception ?) please explain ..

    • @maximumautomation
      @maximumautomation  Год назад +1

      getshadowroot method is defined using css selector only. So if you give any other locator it will throw an exception. And regarding the question, why other locator don't work on shadow DOM? Because original DOM don't have any information of the element of shadow trees.
      Hope it answers your question.

    • @sreedharSN-ft8fm
      @sreedharSN-ft8fm Год назад

      @@maximumautomation This answer is helpful, Thank you so much .. Looking forward ..

  • @Jay-gb8uv
    @Jay-gb8uv 4 месяца назад +1

    Dear Sir, Can you explain the code at 10:10, why did you not call getshadowhost() method?

    • @maximumautomation
      @maximumautomation  4 месяца назад +1

      If you see the element hierarchy then you will find the tag 'settings-appearance-page' does not come under shadow root. We can directly reach this tag element using the earlier element.

    • @Jay-gb8uv
      @Jay-gb8uv 4 месяца назад +1

      @@maximumautomation OMG Thankyou, and congratulations, Well recommended channel

  • @zlegend-wh6pt
    @zlegend-wh6pt 8 месяцев назад +1

    love it!

  • @rohitchauhan9891
    @rohitchauhan9891 Год назад +1

    Thankyou you are great

  • @sarathr4495
    @sarathr4495 4 месяца назад +1

    Helpful

  • @scripauto539
    @scripauto539 Год назад +1

    i like this video..
    but how to select time using showdow-root concept

    • @maximumautomation
      @maximumautomation  Год назад +2

      Sorry I didn't get it. Could you please give an example?

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

    Have a question is ist same with accessing the document element is the dom?

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

      Sorry, but I didn't understand your question.

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

      ​@@maximumautomation I have a I frame and inside an there is a document and inside that there is element and I need to click on it. I switched to but when iam trying to access the element . The element is not accessible because its present inside the document tag . So how to resolve this issue . Will be helpfull if u make an video aswell.Thankw in advance

  • @gabrieln.6064
    @gabrieln.6064 8 месяцев назад +1

    I love you

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

    ░p░r░o░m░o░s░m░ 😕