0

I learn Selenium in Java and I'm struggling with little problem. I'm working on handling dropdowns and to resolve my probelm I have to use Select class. I wrote a selector:

@FindBy(css="#speed")
WebElement selectSpeed;

Then I wrote a method :

public SelectMenuPage selectRandomSpeed(){
getWaitForTheElement().untilElementIsPresentCss("#speed");
      //webDriverWait.until(ExpectedConditions.presenceOfElementLocated(By.cssSelector(locator)));
        Select select = new Select(selectSpeed);
        select.selectByIndex(0);
        return this;
    }

The problem is that when I use Select class the code simply does not work and I receive:

org.openqa.selenium.ElementNotInteractableException: element not interactable: 
Element is not currently visible and may not be manipulated

It works very well when, instead of using Select, I just put the selectors of all the wanted elements and just simply interact with them. Unfortunately, I have to use Select class.

Here is my DOM enter image description here

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
blofeld
  • 19
  • 3

1 Answers1

0

As per the HTML, the tag is having the style attribute set as display: none;.

display_none

Unless the element is visible within the HTML DOM Select() may not work properly.

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352