Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does screen resolution break selenium tests?

I've coded my scripts using a screen resolution of 1920x1080(16:9) and now I'm running on a jenkins slave which I noticed has 1024x768(4:3) and tests just fail. Is this because the screen resolution is breaking the DOM? I'm thinking that this is because failures are caused by elements not being found (not quite sure if the right word) but I would think that even if layout is not responsive elements should be found? Anyone know if this is the cause and how to get around it?

like image 836
PyNaobie Avatar asked Sep 27 '22 02:09

PyNaobie


1 Answers

I did come across the same issue and I resolved it by setting the dimensions to the resolution I wanted:

driver.manage().window().setSize(new Dimension(1920, 1080));

It worked perfect for me.

like image 59
Sukruthi Avatar answered Oct 03 '22 02:10

Sukruthi