Skip to main content
added 2 characters in body
Source Link
alecxe
  • 11.4k
  • 11
  • 51
  • 107

I'm trying to automate a testcase, where in there are around 30 links in a page. All these links will lead to a new page. And depending upon on a value in the new page, I need to either proceed or need to come back to the original page and re-select the link. This needs to be done until I find a particular value in the new page.

So, I got a List of the links, then I started iterating, but as soon as I navigate back, either using driver.navigate().back()driver.navigate().back() or another option and then try to find & click the next link, it hits StaleElementExceptionStaleElementException. Any

Any idea how I can handle this situation? Any help, code or approach wise would be highly appreciated!

I'm trying to automate a testcase, where in there are around 30 links in a page. All these links will lead to a new page. And depending upon on a value in the new page, I need to either proceed or need to come back to the original page and re-select the link. This needs to be done until I find a particular value in the new page.

So, I got a List of the links, then I started iterating, but as soon as I navigate back, either using driver.navigate().back() or another option and then try to find & click the next link, it hits StaleElementException. Any idea how I can handle this situation? Any help, code or approach wise would be highly appreciated!

I'm trying to automate a testcase, where in there are around 30 links in a page. All these links will lead to a new page. And depending upon on a value in the new page, I need to either proceed or need to come back to the original page and re-select the link. This needs to be done until I find a particular value in the new page.

So, I got a List of the links, then I started iterating, but as soon as I navigate back, either using driver.navigate().back() or another option and then try to find & click the next link, it hits StaleElementException.

Any idea how I can handle this situation? Any help, code or approach wise would be highly appreciated!

Source Link
kanayikkaran
  • 189
  • 2
  • 2
  • 7

StaleElementException - After using navigate().back()

I'm trying to automate a testcase, where in there are around 30 links in a page. All these links will lead to a new page. And depending upon on a value in the new page, I need to either proceed or need to come back to the original page and re-select the link. This needs to be done until I find a particular value in the new page.

So, I got a List of the links, then I started iterating, but as soon as I navigate back, either using driver.navigate().back() or another option and then try to find & click the next link, it hits StaleElementException. Any idea how I can handle this situation? Any help, code or approach wise would be highly appreciated!