I have an automation testing project using LeanFT automation tool (in Java). Those tests covers UI flows of a web application.
Jenkins job execute those tests nightly on remote slave RDP VM.
I realized that tests sometimes fail, but couldn't spot the exact reason. After investigation, i found out that if the last user logged in to the VM had resolution different than 1920 X 1080 (for example login to the with laptop with different native resolution) tests are failing.
I am using LeanFT VRI method (Visual Relational Identifiers) in my tests to identify objects which have no ID, meaning identifying objects based on other objects in the DOM (closest on x/y Axis). so this is obviously related to screen resolution.
My question is: How can i insure my tests start with the needed screen resolution, regardless to the last login resolution ? I assume i need a way to override the existing resolution using Jenkins parameter or adding some line of code to my testing project to support a case which resolution is different than 1920 x 1080.