Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify step 'When I click on element located...' to work with StaleElementReferenceException #3190

Closed
Sh-test opened this issue Sep 23, 2022 · 0 comments · Fixed by #3235
Closed
Labels
feature New feature or request
Milestone

Comments

@Sh-test
Copy link
Contributor

Sh-test commented Sep 23, 2022

We periodically meet 'Stale element reference' error when clicking on a button with the step 'When I click on element located'. In this case, clicking step is marked as broken and scenario fails.

2022-09-23_10h12_08

Please modify step 'When I click on element located...' for work with this issue to be able to pass this step without an error.

Full error stack trace:

org.openqa.selenium.StaleElementReferenceException: stale element reference: element is not attached to the page document
(Session info: chrome=105.0.5195.127)
For documentation on this error, please visit: https://selenium.dev/exceptions/#stale_element_reference
Build info: version: '4.1.4', revision: '535d840ee2'
System info: host: '-------', ip: '--------', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '17.0.2'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Command: [5e89edc50df10daaef4a1734ab5e12a8, clickElement {id=1c0e4178-c42a-47e1-aec3-b804b0508d51}]
Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 105.0.5195.127, chrome: {chromedriverVersion: 105.0.5195.52 (412c95e51883..., userDataDir: C:\Users\VIACHA~1\AppData\L...}, goog:chromeOptions: {debuggerAddress: localhost:53126}, javascriptEnabled: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: WINDOWS, platformName: WINDOWS, proxy: Proxy(), se:cdp: ws://localhost:53126/devtoo..., se:cdpVersion: 105.0.5195.127, setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify, webauthn:extension:credBlob: true, webauthn:extension:largeBlob: true, webauthn:virtualAuthenticators: true}
Element: [[ChromeDriver: chrome on WINDOWS (5e89edc50df10daaef4a1734ab5e12a8)] -> xpath: (//*[normalize-space(@data-testid)='bookmark.button']/span)[1]]
Session ID: 5e89edc50df10daaef4a1734ab5e12a8
at jdk.internal.reflect.GeneratedConstructorAccessor47.newInstance(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
at org.openqa.selenium.remote.codec.w3c.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:200)
at org.openqa.selenium.remote.codec.w3c.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:133)
at org.openqa.selenium.remote.codec.w3c.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:53)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:184)
at org.openqa.selenium.remote.service.DriverCommandExecutor.invokeExecute(DriverCommandExecutor.java:167)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:142)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:567)
at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:251)
at org.openqa.selenium.remote.RemoteWebElement.click(RemoteWebElement.java:77)
at org.vividus.selenium.element.DelegatingWebElement.click(DelegatingWebElement.java:45)
at jdk.internal.reflect.GeneratedMethodAccessor70.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.openqa.selenium.support.events.EventFiringWebDriver$EventFiringWebElement.lambda$new$0(EventFiringWebDriver.java:414)
at jdk.proxy2/jdk.proxy2.$Proxy72.click(Unknown Source)
at org.openqa.selenium.support.events.EventFiringWebDriver$EventFiringWebElement.click(EventFiringWebDriver.java:427)
at org.vividus.ui.web.action.MouseActions.click(MouseActions.java:76)
at org.vividus.ui.web.action.MouseActions.click(MouseActions.java:62)
at org.vividus.steps.ui.web.ElementSteps.clickOnElement(ElementSteps.java:291)
at jdk.internal.reflect.GeneratedMethodAccessor67.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.jbehave.core.steps.StepCreator$ParametrisedStep.perform(StepCreator.java:857)
at org.jbehave.core.steps.StepCreator$ReportingAbstractStep.perform(StepCreator.java:678)
at org.jbehave.core.embedder.PerformableTree$FineSoFar.run(PerformableTree.java:397)
at org.jbehave.core.embedder.PerformableTree$PerformableSteps.perform(PerformableTree.java:1423)
at org.jbehave.core.embedder.PerformableTree$AbstractPerformableScenario.perform(PerformableTree.java:1274)
at org.jbehave.core.embedder.PerformableTree$AbstractPerformableScenario.performRestartableSteps(PerformableTree.java:1254)
at org.jbehave.core.embedder.PerformableTree$AbstractPerformableScenario.performScenario(PerformableTree.java:1266)
at org.jbehave.core.embedder.PerformableTree$NormalPerformableScenario.perform(PerformableTree.java:1314)
at org.jbehave.core.embedder.PerformableTree$PerformableScenario.perform(PerformableTree.java:1200)
at org.jbehave.core.embedder.PerformableTree$PerformableStory.performScenarios(PerformableTree.java:1089)
at org.jbehave.core.embedder.PerformableTree$PerformableStory.perform(PerformableTree.java:1064)
at org.jbehave.core.embedder.PerformableTree.performCancellable(PerformableTree.java:514)
at org.jbehave.core.embedder.PerformableTree.perform(PerformableTree.java:481)
at org.jbehave.core.embedder.StoryManager$EnqueuedStory.call(StoryManager.java:300)
at org.jbehave.core.embedder.StoryManager$EnqueuedStory.call(StoryManager.java:273)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:833)

Additional context
Vividus version: 0.4.9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants