Test only fails in test environment


Im currently trying to debug a test case that is only failing in our test environment.

Both machines are setup the same.

Im testing against an Android 4.4 device with an Android App. The test launches an App and an alert window pops up. I currently have a try/catch waiting for the element then clicking. It feels like a race condition. I’ve tried to validate this by adding Thread.Sleeps to help narrow the problem down but it didn’t work.

At this point I’m trying to think of more logging to add to help track down the issue…

Would really appreciate some help narrowing down this issue! All my tests are pretty much useless if this keeps happening. Not reliable :frowning:


paste code where it fails.

Thanks for the quick reply!

I was able to get to get it to work by restarting the device. It must of been in a bad state.

It was the first call into the app after starting. Maybe adding a check to see if the app is responsive or currently open would help