Open BSuneel opened 1 year ago
Your code looks fine, it is most likely an issue with the Jenkins virtual display setup. Check the screenshots on the jenkins build to see what it is doing.
Hi John Ferguson Smart,
The below code working fine with Firefox browser from Jenkins, not with chrome browser.
serenity.browser.maximized=true
chrome.switches =--start-maximized
serenity.browser.width=1920
serenity.browser.height=1080
Find the below screenshots and logs: Firefox browser:
12:28:40 INFO: Detected dialect: W3C 12:28:41 Before window size is: 1920x1080 12:28:41 2023-06-27 01:58:41,780 9112 [main] INFO c.t.automation.common.OpenSite - Privacy error not displayed, Hence going with securely. 12:28:42 After window size is: 1920x1080 12:28:43 2023-06-27 01:58:43,216 10548 [main] INFO c.t.a.e.n.EsatLoginPageActions - User has entered emaild 12:28:43 2023-06-27 01:58:43,268 10600 [main] INFO c.t.a.e.n.EsatLoginPageActions - User has provided the Password
Chrome Browser
12:41:37 Before window size is: 1044x788 12:41:37 2023-06-27 02:11:37,600 5986 [main] INFO c.t.automation.common.OpenSite - Privacy error not displayed, Hence going with securely. 12:41:37 After window size is: 1044x788 12:41:37 2023-06-27 02:11:37,800 6186 [main] INFO c.t.automation.utils.TfDriverWait - JQuery call is in Progress 12:41:38 2023-06-27 02:11:38,470 6856 [main] INFO c.t.a.e.n.EsatLoginPageActions - User has entered emaild
The chrome browser getting 1044x788 resolution. Due to this small resolution menus are overlapping and scripts are failing in chrome browser.
Note: The same script working as expected with Firefox browser.
Any suggestions for chrome browser issue. Thanks in Advance.
I am working on running Selenium(Serenity) scripts in Jenkins. Here, my browser window size which is 1920x1080 px resolution and chrome version is 114.0.5735.199. The script is working as expected in locally but not from Jenkins.
I have tried the below codes
Logic One: Dimension size = getDriver().manage().window().getSize(); int width = size.getWidth(); int height = size.getHeight(); // print the current window size System.out.println("Before window size is: " + width + "x" + height);
Logic Two : Dimension size = getDriver().manage().window().getSize(); int width = size.getWidth(); int height = size.getHeight(); // print the current window size System.out.println("Before window size is: " + width + "x" + height); getDriver().manage().window().setSize(new Dimension(1920, 1080)); System.out.println("After window size is: " + width + "x" + height);
Logic Three: From serenity config file.
The same configurations are working fine from locally(Windows Machine- Eclipse) but from Jenkins not.
I'm using the below versions: Serenity : 2.0.41 Chrome Browser : 114.0.5735.199