Skip to content

Lots of Random Failures on Find Operations when running on Build Server #811

Answered by egil
groogiam asked this question in Q&A
Discussion options

You must be logged in to vote

If you are getting ElementNotFoundException on tests that pass on your local machine but fail in CI, it's very likely you have asynchronous code in your components that execute slower in CI, and causes the timings of your test to be different.

bUnit has a bunch of methods to get around that:

  • WaitForAssertion
  • WaitForState
  • WaitForElement/WaitForElements (these are probably the ones you need instead of Find/FindAll)

The docs for WaitForAssertion explain the scenario's where you need those and the logic behind them: https://bunit.dev/docs/verification/async-assertion.

We dont have docs for WaitForElement/WaitForElements yet, bit the basic logic behind them is the same, it's just the return …

Replies: 2 comments 13 replies

Comment options

linkdotnet
Aug 2, 2022
Maintainer Sponsor

You must be logged in to vote
11 replies
@egil
Comment options

@groogiam
Comment options

@egil
Comment options

@linkdotnet
Comment options

linkdotnet Aug 3, 2022
Maintainer Sponsor

@egil
Comment options

Comment options

You must be logged in to vote
2 replies
@groogiam
Comment options

@groogiam
Comment options

Answer selected by groogiam
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants