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

UI test is flaky, randomly failing with "stale element not found" (OSOE-661) #81

Closed
Piedone opened this issue Jul 21, 2023 · 0 comments · Fixed by #82
Closed

UI test is flaky, randomly failing with "stale element not found" (OSOE-661) #81

Piedone opened this issue Jul 21, 2023 · 0 comments · Fixed by #82
Assignees
Labels
bug Something isn't working

Comments

@Piedone
Copy link
Member

Piedone commented Jul 21, 2023

BehaviorBaseThemeTests in OSOCE, and specifically TestBaseThemeSiteSettingsAsync is flaky, often failing in GHA with the following exception:

OpenQA.Selenium.StaleElementReferenceException: stale element reference: stale element not found
  (Session info: headless chrome=114.0.5735.199); For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#stale-element-reference-exception
   at OpenQA.Selenium.WebDriver.UnpackAndThrowOnError(Response errorResponse, String commandToExecute)
   at OpenQA.Selenium.WebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
   at OpenQA.Selenium.WebDriver.PerformActions(IList`1 actionSequenceList)
   at OpenQA.Selenium.Interactions.Actions.Perform()
   at Atata.IWebDriverExtensions.Perform[T](T driver, Func`2 actionsBuilder)
   at Lombiq.Tests.UI.Extensions.NavigationWebElementExtensions.<>c__DisplayClass0_0.<<ClickReliablyAsync>b__0>d.MoveNext() in D:\a\Open-Source-Orchard-Core-Extensions\Open-Source-Orchard-Core-Extensions\test\Lombiq.UITestingToolbox\Lombiq.Tests.UI\Extensions\NavigationWebElementExtensions.cs:line 44
--- End of stack trace from previous location ---
   at Lombiq.Tests.UI.Extensions.ExtendedLoggingExtensions.<>c__DisplayClass23_0.<<ExecuteSectionAsync>b__0>d.MoveNext() in D:\a\Open-Source-Orchard-Core-Extensions\Open-Source-Orchard-Core-Extensions\test\Lombiq.UITestingToolbox\Lombiq.Tests.UI\Extensions\ExtendedLoggingExtensions.cs:line 100
--- End of stack trace from previous location ---
   at Lombiq.Tests.UI.Extensions.ExtendedLoggingExtensions.ExecuteSectionAsync[TResult](UITestContext context, LogSection section, Func`1 functionAsync) in D:\a\Open-Source-Orchard-Core-Extensions\Open-Source-Orchard-Core-Extensions\test\Lombiq.UITestingToolbox\Lombiq.Tests.UI\Extensions\ExtendedLoggingExtensions.cs:line 111
   at Lombiq.BaseTheme.Tests.UI.Extensions.TestCaseUITestContextExtensions.TestBaseThemeSiteSettingsAsync(UITestContext context, Func`1 selectFromMediaLibraryAsync, By byIcon) in D:\a\Open-Source-Orchard-Core-Extensions\Open-Source-Orchard-Core-Extensions\src\Themes\Lombiq.BaseTheme\Lombiq.BaseTheme.Tests.UI\Extensions\TestCaseUITestContextExtensions.cs:line 101
   at Lombiq.OSOCE.Tests.UI.Tests.ThemeTests.BehaviorBaseThemeTests.<>c.<<ThemeFeaturesShouldWork>b__1_0>d.MoveNext() in D:\a\Open-Source-Orchard-Core-Extensions\Open-Source-Orchard-Core-Extensions\test\Lombiq.OSOCE.Tests.UI\Tests\ThemeTests\BehaviorBaseThemeTests.cs:line 27
--- End of stack trace from previous location ---
   at Lombiq.Tests.UI.Services.UITestExecutionSession`1.ExecuteAsync(Int32 retryCount, String dumpRootPath) in D:\a\Open-Source-Orchard-Core-Extensions\Open-Source-Orchard-Core-Extensions\test\Lombiq.UITestingToolbox\Lombiq.Tests.UI\Services\UITestExecutionSession.cs:line 112

Example builds:

This behavior is exhibited mostly under Windows GHA builds, but it also happens under Linux, just less frequently.

Jira issue

@Piedone Piedone added the bug Something isn't working label Jul 21, 2023
@github-actions github-actions bot changed the title UI test is flaky, randomly failing with "stale element not found" UI test is flaky, randomly failing with "stale element not found" (OSOE-661) Jul 21, 2023
@DemeSzabolcs DemeSzabolcs self-assigned this Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants