Issue
I have my regression suite setup in jenkins and it executes on windows server 2012 r2. Recently I changed screen resolution to 1920,1080 by using below code
driver.manage().window().setSize(new Dimension(1920,1080));
All the other test scripts get passed except two ( let's say script1 and script2 ) in headless mode on the server. But those two scrips get passed in my local machine in both headless and browser mode.
And also when I execute those two scripts in browser mode on the server with the same screen resolution, again they get passed.
When I change the screen resolution to
driver.manage().window().setSize(new Dimension(1366,768));
It get passed on the server in headless mode.
Since I'm using the same configurations for the rest of the scripts. I couldn't think of an exact thing happening here. When I build the Jenkins job, it executes all the other scripts and when it comes to script1 execution hangs. Jenkins build also hangs and doesn't come to the end. Looking for a solution for this.
I'm using webdrivermanager and chrome version of the server is 96
Solution
I did troubleshoot and here are my findings,
- It was a loop which was never ending if element not found
- inside the loop, it searches for an element which was appeared only in a small screen resolutions (arrow button to navigate through some tabs. when the screen resolution is higher, all the tabs appear in the page and no arrow button visible)
So that's the reason those scripts work in small screen resolution and failed in higher resolutions
I changed the loop accordingly and now I can execute all the scripts with higher resolution on the server with headless mode
Answered By - Mahee99
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.