Issue
I have a script where I'm trying to push a button on an ecommerce site but when I run a script I get "Exception in thread "main" org.openqa.selenium.ElementNotInteractableException: element not interactable "
.
When I put xpath into the chropath, element is located so I guess path driver.findElement(By.xpath("//form/fieldset[2]/button")).click();
is right. Please see attached screenshots and be gentle I'm new to programming and this site :/
Solution
I see, there's an Accept cookies button, if you want to click on that, you can use the below code :-
WebDriverWait wait = new WebDriverWait(driver, 30);
wait.until(ExpectedConditions.elementToBeClickable(By.cssSelector("button#onetrust-accept-btn-handler"))).click();
and then click on Sleeve length
like this :
wait.until(ExpectedConditions.elementToBeClickable(By.xpath("//form/fieldset[2]/button"))).click();
Note that you should open browser in full screen before interacting any web element.
driver.manage().window().maximize();
driver.get("Your URL");
Answered By - cruisepandey