Skip to content

Commit e7c69ef

Browse files
committed
Updated code with hub https reference. Starting with Chrome version 83,
use width of 1840 instead of 1920 to capture the entire webpage on video recording.
1 parent e3d286c commit e7c69ef

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

  • java_test_example/src/test/java/java_example

‎java_test_example/src/test/java/java_example/test.java‎

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
// NOTE: replace USERNAME:ACCESS_KEY@YOUR_SUBDOMAIN and VIDEO_URL with your credentials found in the Gridlastic dashboard
1+
// NOTE: replace USERNAME:ACCESS_KEY@HUB_SUBDOMAIN and VIDEO_URL with your credentials found in the Gridlastic dashboard
22
// ALSO SEE https://github.com/Gridlastic/demo1 FOR JAVA TESTNG EXAMPLES WITH PARALLEL TEST EXECUTIONS
3-
// FOR SELENIUM VERSION 3.53+, FIREFOX VERSIONS 55+ REQUIRES THE BINARY LOCATION ON THE GRID NODE TO BE SPECIFIED.
3+
// FOR SELENIUM VERSION 3.53 - 3.9.1, FIREFOX VERSIONS 55+ REQUIRES THE BINARY LOCATION ON THE GRID NODE TO BE SPECIFIED.
44

55
package java_example;
66

@@ -72,12 +72,11 @@ public void beforeMethod() throws Exception {
7272
//Chrome specifics
7373
if (browser_name.equalsIgnoreCase("chrome")){
7474
ChromeOptions options = new ChromeOptions();
75-
options.addArguments("disable-infobars"); // starting from Chrome 57 the info bar displays with "Chrome is being controlled by automated test software.". This flag has been disabled by Google from Chrome version 75.
76-
75+
7776
// On Linux start-maximized does not expand browser window to max screen size. Always set a window size.
7877
if (platform_name.equalsIgnoreCase("linux")) {
7978
options.addArguments(Arrays.asList("--window-position=0,0"));
80-
options.addArguments(Arrays.asList("--window-size=1920,1080"));
79+
options.addArguments(Arrays.asList("--window-size=1840,1080")); // starting with Chrome version 83, use width of 1840 instead of 1920 to capture the entire webpage on video recording.
8180
} else {
8281
options.addArguments(Arrays.asList("--start-maximized"));
8382
}
@@ -98,8 +97,8 @@ public void beforeMethod() throws Exception {
9897

9998
}
10099

101-
//replace USERNAME:ACCESS_KEY@SUBDOMAIN with your credentials found in the Gridlastic dashboard
102-
driver = new RemoteWebDriver(new URL("http://USERNAME:ACCESS_KEY@YOUR_SUBDOMAIN.gridlastic.com:80/wd/hub"),capabilities);
100+
//replace USERNAME:ACCESS_KEY@HUB_SUBDOMAIN with your credentials found in the Gridlastic dashboard
101+
driver = new RemoteWebDriver(new URL("https://USERNAME:ACCESS_KEY@HUB_SUBDOMAIN.gridlastic.com/wd/hub"),capabilities);
103102
driver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);
104103

105104
// On LINUX/FIREFOX the "driver.manage().window().maximize()" option does not expand browser window to max screen size. Always set a window size.

0 commit comments

Comments
 (0)