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']"));