次のコードを使用して、リンクの数をクリックしました
Thread.sleep(5000);
System.out.println("Click on "+ linkelement.get(i).getAttribute("href"));
driver.navigate().to(Filtered_links[i]);
Thread.sleep(5000);
driver.switchTo().window(homeWindow);
ただしthread.sleep()
、ページが変更された場所でメソッドを使用しましたが、以下のエラーが引き続き発生します。
Exception in thread "main" org.openqa.selenium.StaleElementReferenceException:
Element not found in the cache - perhaps the page has changed since it `enter code
here`was looked up
誰でも理由がわかります....!:(