コード:I getException "メイン" org.openqa.selenium.ElementNotInteractableException
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();
エラーマッサージ:スレッドで
例外 "メイン" org.openqa.selenium.ElementNotInteractableException:
セッションID:0で sun.reflect.NativeConstructorAccessorImpl.newInstance0(ネイティブメソッド) で4bfaaf77-6275-4ffc-a8d7-b24b70f3acca java.lang.reflect.Constructor.newInstanceで sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) (Constructor.java:422)でsun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) でorg.openqa.selenium.remote.http.W3CHttpResponseCodec.createException org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:122)で(W3CHttpResponseCodec.java:187) におけるORG .openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:49) at org.openqa.selenium.remote.HttpCommandExecutor.execute (HttpCommandExecutor.java:164) でorg.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83) org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:601で) でorg.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:279) でorg.openqa.selenium.remote.RemoteWebElement.click(RemoteWebElement.java:83) Aufgabe1.Main.mainで(Main.java:41)
このコードで何が問題になっていますか?私はクリックできませんが、要素が見つかりました。
[Selenium WebDriverの可能な複製は "スレッドで例外が発生しました"メイン "org.openqa.selenium.ElementNotInteractableException:要素が表示されない"エラー(https://stackoverflow.com/questions/44690971/selenium-webdriver-throws -exception-in-thread-main-org-openqa-selenium-elemen) – DebanjanB