Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Selenium test hangs on css transition when chrome window is sent to background on mac

I'm experiencing an annoying issue while running my behat selenium tests on my mac, El capitan.

I have a test that opens a modal that will hang if the chrome window is behind another window. As soon as I click on the chrome window to bring it to the front, the test continues and passes.

The modal uses a css transition to show. If I remove the transition, the test passes. If I keep a portion of the browser visible, the test passes.

I'm unsure if this is mac doing some kind of performance optimization or chrome. Anyone know of a way I can disable this? I'd rather not have to disable css transitions or run chrome headless.

like image 522
jdewit Avatar asked Oct 16 '25 17:10

jdewit


1 Answers

Here I found a good article and it helped me to find some flags for Chromium:
--disable-renderer-backgrounding — Prevent renderer process backgrounding when set.
--disable-background-timer-throttling — Disable task throttling of timer tasks from background pages.
--disable-backgrounding-occluded-windows — Disable backgrounding renders for occluded windows. Done for tests to avoid nondeterministic behavior.

These flags really fixed the problem for me.

Some time ago I found mentioned and tried these flags --disable-gpu --disable-d3d11. But they did not help.

More described flags can be found here.

like image 141
Inversion Avatar answered Oct 18 '25 13:10

Inversion



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!