Closed Smat26 closed 6 years ago
what is the status here?
So I looked this up in a lot of detail.
I compared the scenarios described above with my own script.
Assertion vs Failed Test. I went case by case to realise where this might choose to be a reason for inconsistency. There are places where it is more appropriate to assert for tests, and I have added those things to the test cases. This has been done.
Explicit This was rather troublesome. explicit wait, wait indefinitely until certain element is on the page, only then it resumes testing. It is more desirable than sleeping, however i found it almost impossible to do this conditional wait on any specific element, because our pages are too dynamic, and it's hard to pin down, under what condition should we stop the wait. I had discussed this with Baqar for his insights to this. I have added a bigger implicit wait in hopes to curtail the affect of unsteady internet.
Thread.sleep: I have removed it, with Implicit wait. So now it polls the DOM, to find whatever element it it looking for. Instead of having wait a constant time of 1 second between every step. This should make the tests run faster now.
@Smat26 Are we done and we should close this?
Their can be flakiness in the tests when they are done.
They can be improved by following practices highlighted in various articles, which are:
Sources https://testing.googleblog.com/2009/06/my-selenium-tests-arent-stable.html https://sqa.stackexchange.com/questions/18307/random-selenium-webdriver-tests-inconsistently-fail-and-pass-on-ie-browser https://www.joecolantonio.com/2014/04/01/the-1-killer-of-selenium-script-performance-and-reliability/ https://sqa.stackexchange.com/questions/32135/fail-vs-error-in-automated-tests