How to write XPath for Hidden and Invisible dropdown elements: SelectorsHub

Поділитися
Вставка
  • Опубліковано 15 вер 2024
  • In this video, you will learn how you can quickly write the XPath for hidden dropdown elements and for those elements which got disappeared from the DOM after inspecting.
    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_TestP...
    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_s. .
    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.selectorsh...
    For more details please checkout homepage-
    www.selectorsh...
    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.

КОМЕНТАРІ • 58

  • @robertofierro223
    @robertofierro223 3 роки тому +3

    thank you for this material, this guide helps me a lot to understand dropdown behavior. Greetings from Chile :D

  • @Maverism
    @Maverism Рік тому +1

    Hi Sanjay sir thank you so much for your unconditional support your trick has worked wonders for me...

  • @hassam361
    @hassam361 Рік тому +3

    You have guided to select iFrames using selenium switch_to command, but after selecting there is a need to unselect the frame as well to start working with elements in the default screen, for this we need to type driver.switch_to.default_content() inorder to unselect the selected frame. Thanks

  • @shreyashpathak2645
    @shreyashpathak2645 2 роки тому +1

    Really Helpful, Thanks For the Solution

  • @naveenkumarroyal3346
    @naveenkumarroyal3346 2 роки тому +1

    Thank You Bro. I blocked with some issue. This Videos plotted a way to clear it.

  • @padminibhavyat.m.9992
    @padminibhavyat.m.9992 2 роки тому +3

    Thank you! But even in debugger mode, I get the tag and when I click on the div to expand, it disappears. So I am getting an empty list.

  • @BajiC
    @BajiC 2 роки тому +1

    It indeed helpful brother.
    Thankyou

  • @zafaryabkhan5013
    @zafaryabkhan5013 2 роки тому +1

    You are great Sanjay 👍

    • @SelectorsHub
      @SelectorsHub  2 роки тому

      Your welcome. You can join my live training to learn more concepts about xpath etc here - selectorshub.com/selectorshub-training/

  • @shehzad1589
    @shehzad1589 2 роки тому +1

    Thanks bro ... it really helped me alot

  • @rraviteja
    @rraviteja 3 роки тому +1

    Thank you very much.

  • @AdityaVishwakarma-d7i
    @AdityaVishwakarma-d7i 5 місяців тому +1

    Hi it is very useful but what to do if I have to get xpath for a suggestion which occur while searching any item through search box in flipkart , because as soon as I right click that suggestion it get gets disappear .

    • @SelectorsHub
      @SelectorsHub  5 місяців тому

      With the help of SelectorsHub Debugger feature you can inspect any kind of dynamic drop-down, suggestions dropdown and dynamic element. Here I have shown flipkart example- ua-cam.com/video/nB8QA68PwvQ/v-deo.htmlsi=ubhYW2XurKMS_HvP

  • @FelpBR
    @FelpBR Рік тому +1

    Thank you❤

  • @liamaluca
    @liamaluca 2 роки тому +1

    thank you very much! Do you help a lot!

    • @SelectorsHub
      @SelectorsHub  2 роки тому

      Your welcome. You can join my live training to learn more concepts about xpath etc here - selectorshub.com/selectorshub-training/

  • @blitzstar9333
    @blitzstar9333 3 роки тому +1

    Thanks it really helped!!

    • @SelectorsHub
      @SelectorsHub  3 роки тому +1

      Glad to hear that. Please share SelectorsHub with your colleagues.

  • @techytalks7270
    @techytalks7270 3 роки тому +1

    thanks!

  • @shailendrapandey4321
    @shailendrapandey4321 2 роки тому +1

    Sir what if as we right click on the element and download starts and we are not able to inspect the element

    • @SelectorsHub
      @SelectorsHub  2 роки тому

      Sure, you can use the SelectorsHub Debugger feature for such elements. Follow this tutorial - ua-cam.com/video/TlnTG641i_o/v-deo.html

  • @CSX7450
    @CSX7450 Рік тому

    Just freeze the page from sources in devtool and your dropdown will not going to collapse. And you can check and find any element locator.

  • @ajitpandey5229
    @ajitpandey5229 3 роки тому +1

    Sir in gobibo when I am click on from and enter the suggestion then it is showing the autosuggestion but when right click then its disappear.
    how to find xpath of such element

    • @SelectorsHub
      @SelectorsHub  3 роки тому

      Please follow this video-
      ua-cam.com/video/CW00y97mXBA/v-deo.html

  • @VarunKumar-yx5nj
    @VarunKumar-yx5nj 3 роки тому +1

    Hi actully in some popover dropdowns when we rightclick on the dropdown element,that element will get selected.so how to handle that one

    • @SelectorsHub
      @SelectorsHub  3 роки тому

      Use SelectorsHub debugger feature for that.

  • @vasanti_kulkarni_YT
    @vasanti_kulkarni_YT 2 роки тому +1

    The organization with which I am working won’t allow us to download and use this … is there any other way

    • @SelectorsHub
      @SelectorsHub  2 роки тому

      Sure you can easily get it unblocked and also you can try on firefox. On firefox, they must have not blocked.
      Follow this video to get it unblock-
      ua-cam.com/video/wH3qbioP_3w/v-deo.html

  • @SimamkeleMangcu
    @SimamkeleMangcu 5 місяців тому

    it's not helpful because everytime i right click, the options of the drop downs they disappear

    • @SelectorsHub
      @SelectorsHub  5 місяців тому

      Pls use SelectorsHub Debugger feature. You can follow this tutorial- ua-cam.com/video/nB8QA68PwvQ/v-deo.htmlsi=t7dLPwP8IiF0Z7PP

  • @YashchiK
    @YashchiK 2 роки тому

    nothing new functionality/ If your element drop down list or info gets from your cookies - this method is not worked

  • @gayathrikannan5314
    @gayathrikannan5314 Рік тому

    How to select drop-down value if drop-down is in shadow root

  • @harmansingh-bq2rm
    @harmansingh-bq2rm 2 роки тому +1

    what if there is ::after pseudocode in the ::after and the dropdownlist only appears when we click on the arrow which is ::after and it is not interactable when we try to automate it even with the selectorshub

    • @SelectorsHub
      @SelectorsHub  2 роки тому +1

      This is a pseudo element which can’t be located through locators as you mentioned well. So for this you will have to figure out if there is any element on which by clicking dropdown will appear.

    • @harmansingh-bq2rm
      @harmansingh-bq2rm 2 роки тому

      @@SelectorsHub yes its an arrow inside a div tag and i don't know any other way to find it other than inspect tool. Its not an anchor tag, or any other clickable element, when i use the inspect element arrow it focuses to the :after code on html section.
      Thank you for your quick response btw.

    • @SelectorsHub
      @SelectorsHub  2 роки тому +1

      @@harmansingh-bq2rm please connect with me on SelectorsHub slack channel, i will help you on this

    • @harmansingh-bq2rm
      @harmansingh-bq2rm 2 роки тому

      @@SelectorsHub Where do i find that channel

    • @padminibhavyat.m.9992
      @padminibhavyat.m.9992 2 роки тому

      @@harmansingh-bq2rm I am facing the same issue. Were you able to find a workaround for this?

  • @harshithareddy2376
    @harshithareddy2376 3 роки тому +1

    But in my application on right click, drop-down is disappearing.how can I get xpath for this elements.could anyone have solution for this, please let me know

    • @SelectorsHub
      @SelectorsHub  3 роки тому

      Yes you can use debugger feature of SelectorsHub. Please checkout the debugger feature

  • @theglorioussapphiremonkey4750
    @theglorioussapphiremonkey4750 3 роки тому +1

    Hi my dropdown gets double click even if its just single click so yeah the contents are still hidden.. any ideas pls?

    • @SelectorsHub
      @SelectorsHub  3 роки тому

      I will have to look into the dropdown. Please connect on SelectorsHub slack group.

    • @theglorioussapphiremonkey4750
      @theglorioussapphiremonkey4750 3 роки тому

      @@SelectorsHub where is the group located? Fb group?

    • @SelectorsHub
      @SelectorsHub  3 роки тому

      @@theglorioussapphiremonkey4750 bit.ly/SH_Slack

  • @UnpluggedGuru
    @UnpluggedGuru 2 роки тому

    Help me for delete delivered pdf file on web whatsapp via vba.🙏🏻

  • @harshithasyamala558
    @harshithasyamala558 2 роки тому

    Not working for my application

  • @kiranbaladora4308
    @kiranbaladora4308 2 роки тому

    copy doesnot copy anything for me

    • @SelectorsHub
      @SelectorsHub  2 роки тому

      For which website? Could you please connect slack channel.

  • @jackshanvenujan3115
    @jackshanvenujan3115 3 роки тому

    But this is not working for all drop list

    • @SelectorsHub
      @SelectorsHub  3 роки тому +1

      Yes for that SelectorsHub has debugger feature. Please find the tutorial for it here
      ua-cam.com/video/ypWrpy920ug/v-deo.html

  • @filipandrevski2298
    @filipandrevski2298 Рік тому

    Hi.
    So i have the xpath:
    //a[normalize-space()='Ambassador Program']
    And how to write the method so Selenium can open that link:
    driver.findElement(By.xpath("//a[normalize-space()='Ambassador Program']")).click();
    ?
    Thank you for the answer.