Questions tagged [staleelementreferenceexception]

StaleElementReferenceException : org.openqa.selenium.StaleElementReferenceException popularly known as StaleElementReferenceException extends org.openqa.selenium.WebDriverException which indicates that a reference to an element is now "stale", which means that the element is no longer attached to the DOM of the page.

StaleElementReferenceException

org.openqa.selenium.StaleElementReferenceException popularly known as StaleElementReferenceException extends org.openqa.selenium.WebDriverException which indicates that a reference to an element is now stale which means that the element is no longer attached to the DOM of the page.

Reference : StaleElementReferenceException

180 questions
0
votes
1 answer

Message: stale element reference: element is not attached to the page document in Python

I have been trying to run the following code in three different weblinks. Code works fine on one weblink. However, it throws an error message about "Message: stale element reference: element is not attached to the page document". I looked into…
0
votes
1 answer

StaleElementReferenceException: stale element reference: element is not attached to the page document

I keep getting an error message in my selenium java project. for(WebElement link:AllTheLinkList) { if (link.getAttribute("href") != null && ! link.getAttribute("href").contentEquals("javascript")) { activeLinks.add(link); …
0
votes
1 answer

Selenium Java - Stale element exception on iterating using enhanced for loop

Use case: Click button on page It open a new div popup (which has all this parent -> child - subchild heirarchy inorder to select template - There can be n number of child and subchilds) Iterate to select each subchild - but have other steps to…
0
votes
0 answers

Stale exception error while browsing through for loop

from selenium import webdriver from selenium.webdriver.support.ui import Select import time path_to_chromedriver = 'C:/Users/WIN7/AppData/Local/Programs/Python/Python37-32/chromedriver.exe' browser =…
0
votes
1 answer

Selenium Python: Middle of loop - stale element error

So my code is trying to go through a list of links (the visible text for all of which is "Annual") and then, when on the new webpage, iterate through around 20 years in a dropdown list of years and download a dataset for each year. So there are two…
0
votes
1 answer

StaleElementReferenceException while iterating over embedded links

On my webpage I have a list of links to sections, each section has links to details. I'm trying to go to each section, then verify all the links are not broken. List sections = driver.findElements(By.xpath("//*[@id='sections']/li/a")); …
tom
  • 1,223
  • 6
  • 16
  • 26
0
votes
4 answers

Message: stale element reference: element is not attached to the page document

Im trying to automate a task we do almost daily. I read that python in combination with selenium would be perfect to approach this task. Any advice is welcome :) See my code below. from selenium import webdriver from selenium.webdriver.common.by…
0
votes
1 answer

Multiple exceptions are not being handled

Currently I'm using multiple exceptions in a for loop. However, they are still throwing exception errors and I'm not certain why they are not being handled. Here is my code: for x in range (15): …
0
votes
0 answers

How to handle StaleElementReferenceException of element inside another element

I have a class called Navigation with simple functionality for navigating the pages of a website. public class Navigation { public IWebElement Inner { get; set; } private IWebElement Next => Inner.FindElement(By.ClassName("Next")); …
Keegan
  • 3
  • 4
0
votes
1 answer

StaleElementReferenceException in iteration with Selenium

Hello I'm trying to scrap some info from t he following page: http://verify.sos.ga.gov/verification/ My code is the following: import sys reload(sys) sys.setdefaultencoding('utf8') from selenium import webdriver from selenium.webdriver.support.ui…
Ian Spitz
  • 301
  • 8
  • 18
0
votes
2 answers

StaleElementReferenceException: My Selenium code won't turn pages

I'm trying to scrape several pages of a site with Selenium and Python, but my code is breaking over and over. I want to be able to enter the page number in the value box given at the bottom of every page. As of now my code does enter the page number…
0
votes
3 answers

I am getting StaleElementReferenceException: element is not attached to the page document

HTMLCODE I am getting StaleElementReferenceException: element is not attached to the page document. I went through some of the solutions that are already there in StackOverflow. It did not work and it continues to throw the same error. Here is the…
0
votes
1 answer

Webdriver Wait or equivalent - with attributes

I have a snippet of code that loops through links in a page using Selenium. I have replaced Time.sleep(3) with a WebDriverWait() to try to speed it up (as I'm running through 50 pages) but I can't get it to work. For some reason implicitly_wait(30)…
0
votes
2 answers

“StaleElementReferenceException” in Selenium for a List

Please refer the below code, this code will fetch all the orderID from findtable method and it passes all of the orderID to clickonIndividualOrderID method so the cursor moves to each orderid and it clicks on it, a new page will come and it fetch…
0
votes
0 answers

How to solve selenium.StaleElementReferenceException when elements aren't in DOM?

I am getting this error: org.openqa.selenium.StaleElementReferenceException: stale element reference: element is not attached to the page document. I tried using a Thread and other solutions given on the website. Still getting the error. A…
1 2 3
11
12