Selenium tests and Chrome driver


I’m currently stuck on an issue where a Selenium test is failing with the Chrome driver because (Postgis) database objects created at the start of the test are not found in a view called by the browser. I’m doing a MyObject.objects.all() both in the test and in the view, and the queryset is empty in the view. With the Firefox (geckodriver) driver, the test passes fine. The test class inherits from StaticLiveServerTestCase.

Does this ring a bell to someone reading this forum?


Well, I think this is related to concurrency. Async (this time at JS level) is hard :stuck_out_tongue:

Hey @claudep!

That’s a good one. All I can think is that the request to the view is kicking-off before the transaction creating the objects is fully committed (otherwise they’d show right?)

I don’t suppose you have a minimal reproduce do you?

Hi Carlton,

That was indeed a very weird bug, especially the behavioral difference between Chrome and Geckodriver. I’m not especially motivated to create a minimal project now that I fixed it (by deporting some code in a .then() JS section). Your guess is probably right. Async and transaction stuff are hard to debug.


Hey @claudep — Glad you fixed it! No problems at all about the lack of a reproduce :grin: — it was more only possible way to help, rather than a must-see. :slight_smile: