I am trying to write such applications in selenium
. Enters the subpage, gets data, goes back, enters the next subpage ...
Unfortunately, an exception
appears to me
"org.openqa.selenium.StaleElementReferenceException: Element is no longer valid"
all right - after reloading it's another page. Any ideas?
Code:
List<WebElement> rows = driver.findElements(By.className("detail-card__heading"));
List<WebElement> cols=new ArrayList<WebElement>();
for(int i=0;i<rows.size();i++){
System.out.println("Nr oferty: "+i);
cols=rows.get(i).findElements(By.tagName("div"));
for(WebElement col:cols) {
System.out.print("cell value "+col.getText());
col.click();
}
driver.get(CurrentUrl);
}