1- // NOTE: replace USERNAME:ACCESS_KEY@SUBDOMAIN and VIDEO_URL with your credentials found in the Gridlastic dashboard
1+ // NOTE: replace USERNAME:ACCESS_KEY@YOUR_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
33// NOTE: THE FIRST TEST ON A GRID NODE AFTER BEING LAUNCHED CAN BE SLOW, FOLLOWING TESTS ARE MUCH FASTER AFTER THE NODE IS "WARMED" UP.
44
@@ -33,7 +33,7 @@ public void beforeMethod() throws Exception {
3333 // these 3 environment variables in each request.
3434 String platform_name = "win7" ;
3535 String browser_name = "firefox" ;
36- String browser_version = "41 " ; // for Chrome leave empty
36+ String browser_version = "46 " ; // for Chrome leave empty
3737
3838 // optional video recording
3939 String record_video = "True" ;
@@ -56,9 +56,9 @@ public void beforeMethod() throws Exception {
5656
5757 // video record
5858 if (record_video .equalsIgnoreCase ("True" )) {
59- capabilities .setCapability ("video" , "True" );
59+ capabilities .setCapability ("video" , "True" ); // NOTE: "True" is a case sensitive string, not boolean.
6060 } else {
61- capabilities .setCapability ("video" , "False" );
61+ capabilities .setCapability ("video" , "False" ); // NOTE: "False" is a case sensitive string, not boolean.
6262 }
6363
6464 if (browser_name .equalsIgnoreCase ("chrome" )){
@@ -74,7 +74,7 @@ public void beforeMethod() throws Exception {
7474
7575
7676 //replace USERNAME:ACCESS_KEY@SUBDOMAIN with your credentials found in the Gridlastic dashboard
77- driver = new RemoteWebDriver (new URL ("http://USERNAME:ACCESS_KEY@SUBDOMAIN .gridlastic.com:80/wd/hub" ),capabilities );
77+ driver = new RemoteWebDriver (new URL ("http://USERNAME:ACCESS_KEY@YOUR_SUBDOMAIN .gridlastic.com:80/wd/hub" ),capabilities );
7878 driver .manage ().timeouts ().implicitlyWait (60 , TimeUnit .SECONDS );
7979 driver .manage ().window ().maximize (); // Always maximize firefox on windows
8080
@@ -85,8 +85,7 @@ public void beforeMethod() throws Exception {
8585
8686
8787 if (record_video .equalsIgnoreCase ("True" )) {
88- System .out
89- .println ("Test Video: " + VIDEO_URL + ((RemoteWebDriver ) driver ).getSessionId ());
88+ System .out .println ("Test Video: " + VIDEO_URL + ((RemoteWebDriver ) driver ).getSessionId ());
9089 }
9190 }
9291
@@ -97,7 +96,7 @@ public void test_site() throws Exception {
9796 WebElement element = driver .findElement (By .name ("q" ));
9897 element .sendKeys ("webdriver" );
9998 element .submit ();
100- Thread .sleep (5000 );
99+ Thread .sleep (5000 ); //slow down for demo purposes
101100 }
102101
103102 @ AfterMethod (alwaysRun = true )
0 commit comments