Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
added 1 character in body; edited title
Source Link
Michael Durrant
  • 25.2k
  • 3
  • 41
  • 113

Getting a staleelementstale element exception (Selenium - Java)

I am using Selenium via Java.

I am running into a stale element exception and I can't seem to identify the issue.

I am interacting with a carousel (see image below). I have placed all the vehicles, in the carousel, into a list and I am trying to get the text back from each webelementweb element in the list. The list contains eight elements. When my code interacts with the last page of the carousel (in this case the sixth element in the list) a stale element exception gets thrown.

Here is the code where I placed all the vehicles in the carousel in a list:

List<WebElement> vehiclesInCarousel = driver.findElements(By.cssSelector("div[data-qaid='cntnr-frntlnlstng-carousel'] ul[class='slider-list'] li[class='slider-slide']"));

enter image description here

Getting a staleelement exception

I am using Selenium via Java.

I am running into a stale element exception and I can't seem to identify the issue.

I am interacting with a carousel (see image below). I have placed all the vehicles, in the carousel, into a list and I am trying to get the text back from each webelement in the list. The list contains eight elements. When my code interacts with the last page of the carousel (in this case the sixth element in the list) a stale element exception gets thrown.

Here is the code where I placed all the vehicles in the carousel in a list:

List<WebElement> vehiclesInCarousel = driver.findElements(By.cssSelector("div[data-qaid='cntnr-frntlnlstng-carousel'] ul[class='slider-list'] li[class='slider-slide']"));

enter image description here

Getting a stale element exception (Selenium - Java)

I am using Selenium via Java.

I am running into a stale element exception and I can't seem to identify the issue.

I am interacting with a carousel (see image below). I have placed all the vehicles, in the carousel, into a list and I am trying to get the text back from each web element in the list. The list contains eight elements. When my code interacts with the last page of the carousel (in this case the sixth element in the list) a stale element exception gets thrown.

Here is the code where I placed all the vehicles in the carousel in a list:

List<WebElement> vehiclesInCarousel = driver.findElements(By.cssSelector("div[data-qaid='cntnr-frntlnlstng-carousel'] ul[class='slider-list'] li[class='slider-slide']"));

enter image description here

Source Link
Robben
  • 1k
  • 2
  • 13
  • 25

Getting a staleelement exception

I am using Selenium via Java.

I am running into a stale element exception and I can't seem to identify the issue.

I am interacting with a carousel (see image below). I have placed all the vehicles, in the carousel, into a list and I am trying to get the text back from each webelement in the list. The list contains eight elements. When my code interacts with the last page of the carousel (in this case the sixth element in the list) a stale element exception gets thrown.

Here is the code where I placed all the vehicles in the carousel in a list:

List<WebElement> vehiclesInCarousel = driver.findElements(By.cssSelector("div[data-qaid='cntnr-frntlnlstng-carousel'] ul[class='slider-list'] li[class='slider-slide']"));

enter image description here