Learn to write selectors for shadow DOM elements: SelectorsHub

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 พ.ย. 2020
  • Want to be expert in XPath, Selectors, WebElement, DOM, SelectorsHub & TestCase Studio, join my training. Registration Link-
    selectorshub.com/selectorshub...
    This video will help you to learn
    1. What is shadow dom
    2. Which all selectors possible for shadow dom elements.
    3. How to write selectors for shadow dom elements
    4. What are the possible solution to write and verify selectors for shadow dom elements.
    SelectorsHub helps to generate, write and verify the XPath & cssSelector.
    SelectorsHub is the complete new way to generate, write and verify the XPath and cssSelectors.
    Checkout SelectorsHub primary Sponsor TestProject- A FREE end-to-end test automation tool.
    bit.ly/Sh_TestProject
    Please be a patron and support SelectorsHub to run it FREE forever.
    Even 1-5$ (a coffee cost) per month will be a great help.
    / sanjaykumar_selectorshub
    SelectorsHub-
    1) It suggests all possible XPath and cssSelector functions while typing like smart editor along with their occurrences to complete Selectors quickly. Now you need not to copy and paste attribute values from DOM anymore to build XPath and cssSelector.
    2) Generate all types of possible selectors in single click.
    3) Copy XPath, cssSelector and JS path from the context menu itself. No need to open DevTools and SelectorsHub tab anymore.
    4) Feature to customise contextMenu.
    5) Feature to disable and enable SelectorsHub in contextMenu
    6) It gives robust unique relative cssSelector and XPath.
    7) It also supports shadowDOM, iframe, frame and SVG elements.
    8) It gives the proper error message like what is wrong in your xpath and cssSelector.
    9) It also gives the index based xpath in auto suggest.
    10) It has the feature to generate selector with the desired attribute.
    11) You can also generate selectors with driver command.
    12) You can customise the UI as you want.
    13) All the config will be saves in local so next time when you open it, it open with your configs.
    14) To copy the Selector's value, just click on copy icon or the Selector's Header.
    15) To edit Selector's value, just click on selector's value, it will put the value in box where you can edit it and verify.
    Please follow video tutorial to make the best use of SelectorsHub.
    • SelectorsHub 2.0 detai...
    If you face any issue or feedback, feel free to reach out to me at selectorshub@gmail.com
    Please find the change log here-
    www.selectorshub.com/changelog/
    For more details please checkout homepage-
    www.selectorshub.com/
    Very simple steps to use the tool-
    1. Open DevTools.
    2. On right side, the last sidebar tab is SelectorsHub. Click on it.
    3. Here it show all possible selectors for inspected element. For whichever element you want to generate selector, just inspect that and it will generate all possible selectors for that element.
    4. To build own XPath or cssSelector, start typing in the selector input box.
    5. SelectorsHub will automatically suggest all attributes and everything to complete Selectors quickly. Now you need not to copy and paste attribute values anymore. With this you can save huge amount of time.
    6. After typing just press enter.
    7. It will high light all matching node and list down them in the SelectorsHub tab.
    8. It will also scroll the web element to viewable area.
    9. To copy selectors value, click on copy icon.
    10. To edit selector value, click on that selector value.

ความคิดเห็น • 54

  • @SelectorsHub
    @SelectorsHub  2 ปีที่แล้ว +2

    Want to be expert in XPath, Selectors, WebElement, DOM, SelectorsHub & TestCase Studio, join my training. Registration Link-
    selectorshub.com/selectorshub-training/

  • @lokeshsinha4777
    @lokeshsinha4777 3 ปีที่แล้ว +4

    Selectorshub have invested so much time and developed this masterpiece, Thank you Selectorshub from SDET community.
    No locator tool is able to tell you if an element is in shadow. But Selectorshub has done it and gives CSS too for further help. Thank you.

    • @SelectorsHub
      @SelectorsHub  3 ปีที่แล้ว

      Thank you for your kindwords. Keep sharing and let others know about it.

  • @kaleemuddinmohammedabdul7647
    @kaleemuddinmohammedabdul7647 3 ปีที่แล้ว +2

    I was ignorant until this.. I don't know their is something called Shadow element .. Thank your enlighten me.. This is wonderful extension.. I like.. the way you display whether the element is in iFrame and the syntax error..

  • @rushikeshdeshmukh3969
    @rushikeshdeshmukh3969 3 ปีที่แล้ว +2

    This is so useful. Thank You Sanjay 👍🏻

  • @James-dn7pw
    @James-dn7pw 3 ปีที่แล้ว +1

    Very informative and much much useful for all the web testers and developers. I guess this is the only solution for Shadow DOM in the planet. Not sure why this video has less view.

  • @forpractice5147
    @forpractice5147 ปีที่แล้ว

    Sir ,Really great Lecture for a long time i am searching this and i finaly i got the idea for this

  • @sharankumarbhorale6468
    @sharankumarbhorale6468 2 ปีที่แล้ว +1

    if u make a video on shadow DOM testing in Katalon Studio that will be very helpful

  • @159binny
    @159binny ปีที่แล้ว +1

    Thanks for the info. Could you please give an example by overriding the shadow style? Because following this I was not able to override.

    • @SelectorsHub
      @SelectorsHub  ปีที่แล้ว

      After locating the element, you can update the style attribute thru selenium or whatever framework you are using

  • @piyushkotiyal9964
    @piyushkotiyal9964 2 ปีที่แล้ว +1

    how can we use webdriver wait in shadow dom where we typecasted driver into javascriptexecutor

  • @tusharkhade10
    @tusharkhade10 3 ปีที่แล้ว +2

    Nice

  • @user-ek2db4dc3v
    @user-ek2db4dc3v 7 หลายเดือนก่อน

    how to style the elements inside the shadow DOM without any inline css

  • @manzurulqayyum8354
    @manzurulqayyum8354 3 ปีที่แล้ว +3

    What the hell is wrong here. Why does this video have so little likes and views. It is such an amazing and innovative utility. This needs more outreach among the SDET community. Thanks a zillion Sanjay.

    • @SelectorsHub
      @SelectorsHub  3 ปีที่แล้ว

      Thank you Manzurul, with the support from people like you it will reach to our whole SDET community. Please keep sharing and supporting community.

  • @olaojeyinka9361
    @olaojeyinka9361 6 หลายเดือนก่อน

    @Sanjay, I hope you are doing well today. Thank you for this plugin. I have a question about my Selectorshub plugin, it does not identify ShadowDom elements when I am testing. Kindly assist.

    • @SelectorsHub
      @SelectorsHub  6 หลายเดือนก่อน

      Please check if that shadow dom is closed shadow dom. Closed shadow dom can’t be inspected. Click on SelectorsHub and then use SelectorsHub inspector to inspect the element, it will let you know if that element is inside closed shadow dom.

  • @yedidimounika9824
    @yedidimounika9824 3 ปีที่แล้ว +1

    Hi sanjay! Could you pls tell how we can write locators for shadow dom using text and index number?

    • @SelectorsHub
      @SelectorsHub  3 ปีที่แล้ว

      1) Shadow DOM supports cssSelector and doesn't support xpath
      2) And cssSelector doesn't support text.
      So we can't use text for selectors for shadow dom elements. Index you can use to write cssSelector. You can cssSelector playlist.
      th-cam.com/play/PLmRg3gEG2XIb8P6qzHuPLK5ANl_h4a7P2.html

  • @ankeshkumar9120
    @ankeshkumar9120 3 ปีที่แล้ว +3

    This is an awesome innovation Sanjay. i already got a glimpse of this during one of the live LocatorsChallenge 4. So just wanted to know if this will be supported in selenium Automation to identify the locators.or ro we need separate extensions to be added to our project.

    • @SelectorsHub
      @SelectorsHub  3 ปีที่แล้ว

      Thank you Ankesh. Yes you will have to add it in your browser as extension and then you can enjoy using it as shown in video.

    • @ankeshkumar9120
      @ankeshkumar9120 3 ปีที่แล้ว +1

      @@SelectorsHub Thanks Sanjay, but if the code is deployed to others system,that person would need to have this added in his extensions list.right.. understood

    • @SelectorsHub
      @SelectorsHub  3 ปีที่แล้ว

      @@ankeshkumar9120 yes.

  • @bhargavi-ph8dr
    @bhargavi-ph8dr ปีที่แล้ว

    Hi sir can you please help me how can we get JavaScript code from selector hub I am getting different code while copying

  • @sanku72
    @sanku72 ปีที่แล้ว

    how can we override the CSS of element which is inside shadow Dom

    • @SelectorsHub
      @SelectorsHub  ปีที่แล้ว

      After accessing the element, you can override the css of element as you do for normal element.

  • @bhargavisai2386
    @bhargavisai2386 3 ปีที่แล้ว +1

    I need to select a value from the dropdown , it has no attributes just it has and it has shadow root as parent. Could you suggest how can I select value in this case in Cypress

    • @SelectorsHub
      @SelectorsHub  3 ปีที่แล้ว

      Sure , i will help you. Please connect on SelectorsHub slack channel

    • @SelectorsHub
      @SelectorsHub  3 ปีที่แล้ว

      Here is the slack link- join.slack.com/t/selectorshub/shared_invite/zt-fho3ep1h-mkjFOdKqmtYWwNVyV8tLSg

  • @user-wp9gs9zh9z
    @user-wp9gs9zh9z 5 หลายเดือนก่อน

    I am using calcite component suppose eg. calcite-flow-item this calcite-flow-item will create header tag inside #shadow-root (open), how can I hide the header tag present inside the shadow-root??

    • @SelectorsHub
      @SelectorsHub  5 หลายเดือนก่อน

      Thru automation, you can’t hide dom element. More we can tell by looking at the DOM.

  • @rishnu5075
    @rishnu5075 3 ปีที่แล้ว +1

    Could have highlighted an element after writing CSS in selectorshub.

  • @truefluekiller
    @truefluekiller ปีที่แล้ว +1

    Awesome! But could you perhaps do a version for Python code as well? Right now you can only extract the Java code from the SelectorsHub plug-in :)

    • @SelectorsHub
      @SelectorsHub  ปีที่แล้ว +1

      Sure, will add it soon.

    • @truefluekiller
      @truefluekiller ปีที่แล้ว

      @@SelectorsHub That would be truely amazing!

  • @RavindraSinghPoetry
    @RavindraSinghPoetry ปีที่แล้ว

    I am unable to locate the element in shadow dom using selectorhub 😕

    • @SelectorsHub
      @SelectorsHub  ปีที่แล้ว

      Please connect with us on live chat from website and share more details like url and screenshot.

  • @poonamsharma7026
    @poonamsharma7026 3 ปีที่แล้ว +1

    What about shadowroot(user-agent),can we automate it?

    • @SelectorsHub
      @SelectorsHub  3 ปีที่แล้ว

      Yes. You can try that if face any issue, let me know.

  • @kmanikandan628
    @kmanikandan628 ปีที่แล้ว

    How to write css selectors for shadow DOM elements without using selectors Hub?

  • @rajia3455
    @rajia3455 2 ปีที่แล้ว

    It's asking login while I am using Selectorshub in my company laptop... What to do?

    • @SelectorsHub
      @SelectorsHub  2 ปีที่แล้ว

      Upgrade to latest version 4.2.8 and Just register once, it will not ask again

    • @rajia3455
      @rajia3455 2 ปีที่แล้ว +1

      @@SelectorsHub Yes, done... Thank you so much

    • @SelectorsHub
      @SelectorsHub  2 ปีที่แล้ว +1

      @@rajia3455 please help your team if anyone of them face this issue. Thank you for your support

  • @shipinpk706
    @shipinpk706 3 ปีที่แล้ว

    Am facing like java script circular reference exception while doing with shadow dom element click.
    If you have any idea about this please reply.

    • @SelectorsHub
      @SelectorsHub  3 ปีที่แล้ว

      Have you edited anything in the script which you got SelectorsHub? First run the script as it is and see if it is working. Looks like you have edited that script and made some mistake.
      A circular reference exception occurs if two separate objects pass references to each other.

    • @shipinpk706
      @shipinpk706 3 ปีที่แล้ว +1

      @@SelectorsHub hi sir... I will add some few points about this scenario
      1. We made no changes in the script which we got from the tool
      2. Its getting pass some times... Eg : if we run 5 times the same script it will pass may be 3 or 2 times
      3. Another thing is that we call the same function two times for the script execution

    • @SelectorsHub
      @SelectorsHub  3 ปีที่แล้ว

      @@shipinpk706 it seems then all the shadow dom was not loaded when script executed. Please increase the wait time before accessing every shadow dom, lets try first with 10sec.

    • @shipinpk706
      @shipinpk706 3 ปีที่แล้ว +1

      @@SelectorsHub thanks for the reply.. We will try with your suggestions.

    • @shipinpk706
      @shipinpk706 3 ปีที่แล้ว

      @@SelectorsHub
      Hi sir.... I tried with your solution but still no hope.... I increase the wait time as 20 sec.... But still it didn't work for me.... I am facing same javascript circular refernce exception in chrome versionn89 and cyclic object value exception in firefox...

  • @mayorc
    @mayorc ปีที่แล้ว

    What's the point of all of this???
    You didn't explain how to write a css selector string at all. "#input" doesn't work. And we know it, so what's the correct selector string for that element inside the shadow dome for using in a different framework like selenium.
    Finding the father_element.shadow_root then using find_element By.CSS_SELECTOR is really tedious. Is there any CSS_SELECTOR string I can use directly from the driver without needing to find all those nested shadow_roots in the middle?