Code:
WebElement betting = driver.findElement(By.id("flex-menu"));
List<WebElement> hallo = betting.findElements(By.xpath("//*[@id='flex-menu']//ul//li//a"));
System.out.println(hallo.get(0).getText());
hallo.get(0).click();
Error Massage:
Exception in thread "main" org.openqa.selenium.ElementNotInteractableException:
Session ID: 4bfaaf77-6275-4ffc-a8d7-b24b70f3acca at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:422) at org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:187) at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:122) at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:49) at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:164) at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:601) at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:279) at org.openqa.selenium.remote.RemoteWebElement.click(RemoteWebElement.java:83) at Aufgabe1.Main.main(Main.java:41)
What is wrong with that Code? I cant Click but it found the Element.