-2

HTML screenshotI am trying to build a test case to select an option from the drop down menu but unable to find the element.

I am new to selenium webdriver module I can find elements using xpath and id but unable to find an element from a drop down menu.

I am able to log into the webpage and click "Queues". Now I want to select "All Items" from the queue but gettig errow

All Items

G.Dhar
  • 23
  • 6
  • 1
    Howdy, it would be easier to help if you posted some of the html you were trying to select. There are some other posts about this already you could also view to see if they meet your needs. Example: https://stackoverflow.com/questions/7867537/how-to-select-a-drop-down-menu-option-value-with-selenium-python I also found a pretty detailed WP site with a post about this: https://seleniumwithjavapython.wordpress.com/selenium-with-python/basics-of-webdriver/handling-dropdowns/ If you post details on your html, more help can be given. – D3TXER Sep 20 '19 at 05:42
  • Sorry I tried to paste the HTML earlier but didn't work. I have uploaded a screenshot if that helps. – G.Dhar Sep 24 '19 at 06:41

1 Answers1

0

If you are not able to find it by selenium and exception is throwing like element not found that probably there is a frame present and your element is inside it. you need to switch to the frame first.

You can refer my or other answer in below link:

How to select frame if there are multiple frames on a webpage and get content of that frame?

If you are not able to find in HTML then use below code

System.out.println(driver.getPageSource());

It just going to print your HTML, now copy it in notepad++ and search your dropdown Text. now create Xpath

Shubham Jain
  • 16,610
  • 15
  • 78
  • 125