ElementNotVisibleException when running headless browser on Jenkins node. Test case runs successfully on local machine using chrome broswer ElementNotVisibleException when running headless browser on Jenkins node. Test case runs successfully on local machine using chrome broswer jenkins jenkins

ElementNotVisibleException when running headless browser on Jenkins node. Test case runs successfully on local machine using chrome broswer


I had the same problem. With me it was the headless screen size. Our Jenkins maintainer group in the company set the default screen size to 640:480 so my page didn't render the way it should. I use Xvfb for setting the screen in Jenkins, using this extra cmd/shell command:

export DISPLAY=:1Xvfb :1 -screen 0 1920x1080x16 &

I hope this helps :)