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);