0

This is the DOM structure. DOM

Any of the following operations are throwing org.openqa.selenium.ElementNotInteractableException

selectFileStatus.selectByIndex(2);

Or

selectFileStatus.selectByVisibleText(valueToSelect);

The instantiation is like this.

Select selectFileStatus = new Select(wait.until(ExpectedConditions.elementToBeClickable(By.xpath(
                property.getPropertyObject(propFileDetailClaimReview).getProperty(propertyDropdownFileStatus)))));

And the XPATH is tested in browser.

//span[contains(text(), 'File Status')]/parent::label/following-sibling::select

Interestingly, a read operation is working fine.

List<WebElement> allOptions = selectFileStatus.getOptions();
System.out.println("*** Values of the dropdown...");
for(WebElement eachOption : allOptions)
    System.out.println(eachOption.getText());

As this <select> tag looks like a real HTML object, what can be the problem here?

Note: Tried JS injection, and it did nothing actually (I expected it to expand the dropdown).

WebElement ele = driver.findElement(By.xpath(
                property.getPropertyObject(propFileDetailClaimReview).getProperty(propertyDropdownFileStatus)));
        JavascriptExecutor executor = (JavascriptExecutor)driver;
        executor.executeScript("arguments[0].click();", ele);
  • Do you get any more detail in the error message? Have you had a look at this post https://stackoverflow.com/questions/43868009/how-to-resolve-elementnotinteractableexception-element-is-not-visible-in-seleni/46601444 – Jocke May 11 '20 at 06:52
  • @Jocke Yes, I had :) This is the error I got - org.openqa.selenium.ElementNotInteractableException: Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'. So, nothing about invisible element here. :) – Nilanjan Guha Majumder May 11 '20 at 07:07
  • Did you try using a JS executor ? – Wilfred Clement May 11 '20 at 07:43
  • @WilfredClement Yes, I did. This code didn't work for me (I wanted to click and expand the dropdown). WebElement ele = driver.findElement(By.xpath( property.getPropertyObject(propFileDetailClaimReview).getProperty(propertyDropdownFileStatus))); JavascriptExecutor executor = (JavascriptExecutor)driver; executor.executeScript("arguments[0].click();", ele); – Nilanjan Guha Majumder May 11 '20 at 09:09

0 Answers0