StaleElementReferenceException after click was made

19 views
Skip to first unread message

medveeee nagy

unread,
Oct 30, 2019, 11:07:27 AM10/30/19
to Geb User Mailing List
hi, 

does anyone have an idea why I get this error 

org.openqa.selenium.StaleElementReferenceException: stale element reference: element is not attached to the page document

although the button was clicked already and navigation was done to the next page successfully?

30-Oct-2019 07:24:35    org.openqa.selenium.StaleElementReferenceException: stale element reference: element is not attached to the page document
30-Oct-2019 07:24:35      (Session info: chrome=78.0.3904.70)
30-Oct-2019 07:24:35    For documentation on this error, please visit: https://www.seleniumhq.org/exceptions/stale_element_reference.html
30-Oct-2019 07:24:35    Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
30-Oct-2019 07:24:35    System info: host: 'abc', ip: 'a.b.c.d', os.name: 'Linux', os.arch: 'amd64', os.version: '3.10.0-957.21.3.el7.x86_64', java.version: '1.8.0_72'
30-Oct-2019 07:24:35    Driver info: org.openqa.selenium.remote.RemoteWebDriver
30-Oct-2019 07:24:35    Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 78.0.3904.70, chrome: {chromedriverVersion: 78.0.3904.70 (edb9c9f3de024..., userDataDir: /tmp/.com.google.Chrome.2U3GYq}, goog:chromeOptions: {debuggerAddress: localhost:40401}, javascriptEnabled: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: LINUX, platformName: LINUX, proxy: Proxy(manual, http=proxy-dc..., setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify, webdriver.remote.sessionid: 1de336d3f21f190d74dac6c6b85...}

It does not happen all the time, it is only occasional.

I simply click the product details button to get to the details page, 
seeing the screenshots it navigates to the detail page and gives me an StaleElementReferenceException, 
but the click was done.

def "Test: Go to productDetail '518326' "() {
 
when:

   waitFor
{ productDetailsButton.displayed }

   productDetailsButton
<< Keys.ENTER

 
then:

   waitFor
{at ProductDetailPage}

   report
"Product '518326' at Productdetailpage screenshot"
}

I am using these versions:

groovyVersion = '2.5.8'
gebVersion
= '3.2'
seleniumVersion
= '3.141.59'
chromeDriverVersion
= '78.0.3904.70'

Thank you!

Marcin Erdmann

unread,
Nov 1, 2019, 7:52:24 AM11/1/19
to geb-...@googlegroups.com
I'm afraid that if you want us to be able to help you will have to provide the full stacktrace and not just a snippet of it. Unfortunately, with the amount of information you provided it's impossible to get the necessary context to be able to understand what is going on.

--
You received this message because you are subscribed to the Google Groups "Geb User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geb-user+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/geb-user/06a521d5-aad6-47cc-ab5a-aae2751ba321%40googlegroups.com.

medveeee nagy

unread,
Nov 6, 2019, 1:54:55 AM11/6/19
to Geb User Mailing List
after upgrading to the newest geb and selenium version I get many stale element errors. why is that?

here is a bit longer log snippet:

06-Nov-2019 07:32:52com.bechtle.test.functional.specifications.next.hardware.shared.assortment.Wishlist_TestSpec > Test: Go to wishlists FAILED06-Nov-2019 07:32:52    org.openqa.selenium.StaleElementReferenceException: stale element reference: element is not attached to the page document06-Nov-2019 07:32:52      (Session info: chrome=78.0.3904.70)06-Nov-2019 07:32:52    For documentation on this error, please visit: https://www.seleniumhq.org/exceptions/stale_element_reference.html06-Nov-2019 07:32:52    Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'06-Nov-2019 07:32:52    System info: host: 'b001cvs001032', ip: '10.252.11.103', os.name: 'Linux', os.arch: 'amd64', os.version: '3.10.0-957.21.3.el7.x86_64', java.version: '1.8.0_72'06-Nov-2019 07:32:52    Driver info: org.openqa.selenium.remote.RemoteWebDriver06-Nov-2019 07:32:52    Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 78.0.3904.70, chrome: {chromedriverVersion: 78.0.3904.70 (edb9c9f3de024..., userDataDir: /tmp/.com.google.Chrome.b47PJo}, goog:chromeOptions: {debuggerAddress: localhost:40401}, javascriptEnabled: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: LINUX, platformName: LINUX, proxy: Proxy(manual, http=proxy-dc..., setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify, webdriver.remote.sessionid: cf9f9862639b93efd0252fc0775...}06-Nov-2019 07:32:52    Session ID: cf9f9862639b93efd0252fc0775e38f206-Nov-2019 07:32:52        at org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:187)06-Nov-2019 07:32:52        at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:122)06-Nov-2019 07:32:52        at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:49)06-Nov-2019 07:32:52        at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:158)06-Nov-2019 07:32:52        at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552)06-Nov-2019 07:32:52        at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:285)06-Nov-2019 07:32:52        at org.openqa.selenium.remote.RemoteWebElement.click(RemoteWebElement.java:84)06-Nov-2019 07:32:52        at geb.navigator.DefaultNavigator.click(DefaultNavigator.groovy:672)06-Nov-2019 07:32:52        at geb.content.TemplateDerivedPageContent.click(TemplateDerivedPageContent.groovy:85)06-Nov-2019 07:32:52        at com.bechtle.test.functional.specifications.next.hardware.shared.assortment.Wishlist_TestSpec.Test: Go to wishlists(Wishlist_TestSpec.groovy:189)


thank you for your help!
To unsubscribe from this group and stop receiving emails from it, send an email to geb-...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages