Why do Selenium tests that pass locally fail on Browserstack specifying exact same browser?

990 views Asked by At

I got a test that opens a webpage and does scraping.

It works. There's no question on that: - Works on Phantomjs/Chrome/Firefox when run on my machine everytime.

However, when run on Browserstack (I want to cover 5 most popular browsers, several OS and even mobile devices, for the moment I specify the exact same browser and platform as on my machine to ensure first the test runs properly on Browserstack), the test SOMETIMES passes and SOMETIMES fails with different errors: - Stale element - No such element in cache - Page fails to load after a submit - etc

And almost never the same element or submit.

Which is making me wonder whether Browserstack has some inherent instability I'm not aware of. Has anyone seen this happen on Browserstack?

1

There are 1 answers

0
Linas Vanskevičius On

Welcome to BS. You get such errors because the environments on BS do lag a lot. They aren't giving much resources to their VMs so you will have to deal with it. Or put a lot of thread sleeps and special waits for your needs