Skip to content

Commit b48894a

Browse files
author
admin
committed
updated java example
1 parent 2db978d commit b48894a

1 file changed

Lines changed: 12 additions & 10 deletions

File tree

  • java_test_example/src/test/java/java_example

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

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import java.net.URL;
44
import java.util.Arrays;
55
import java.util.concurrent.TimeUnit;
6+
67
import org.openqa.selenium.Platform;
78
import org.openqa.selenium.chrome.ChromeOptions;
89
import org.openqa.selenium.remote.DesiredCapabilities;
@@ -13,19 +14,20 @@
1314

1415
public class test {
1516

17+
private static final String VIDEO_URL = null;
1618
private RemoteWebDriver driver;
1719

1820
@BeforeMethod(alwaysRun = true)
1921
public void beforeMethod() throws Exception {
2022

2123
// Example test environment. NOTE: Gridlastic auto scaling requires all
2224
// these 3 environment variables in each request.
23-
String platform_name = "win8";
24-
String browser_name = "chrome";
25-
String browser_version = ""; // for Chrome leave empty
25+
String platform_name = "linux";
26+
String browser_name = "firefox";
27+
String browser_version = "36"; // for Chrome leave empty
2628

2729
// optional video recording
28-
String record_video = "False";
30+
String record_video = "True";
2931

3032
DesiredCapabilities capabilities = new DesiredCapabilities();
3133
if (platform_name.equalsIgnoreCase("win7")) {
@@ -56,19 +58,19 @@ public void beforeMethod() throws Exception {
5658
capabilities.setCapability(ChromeOptions.CAPABILITY, options);
5759
}
5860

61+
62+
5963
driver = new RemoteWebDriver(
6064
new URL(
61-
"http://ec2-54-176-153-50.us-west-1.compute.amazonaws.com:47665/wd/hub"),
65+
"http://USERNAME:ACCESS_KEY@SUBDOMAIN.gridlastic.com:4444/wd/hub"),
6266
capabilities);
6367
driver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);
64-
if (!browser_name.equalsIgnoreCase("chrome")){
65-
driver.manage().window().maximize(); //the window maximize is buggy for chrome using latest chrome 38 version
66-
}
68+
driver.manage().window().maximize();
69+
6770

6871
if (record_video.equalsIgnoreCase("True")) {
6972
System.out
70-
.println("Test Video: https://s3-us-west-1.amazonaws.com/027a15f2-530d-31e5-f8cc-7ceaf6355377/8dc7b04e-6a48-58e9-b901-17ba724ce4ee/play.html?"
71-
+ ((RemoteWebDriver) driver).getSessionId());
73+
.println("Test Video: " + VIDEO_URL + ((RemoteWebDriver) driver).getSessionId());
7274
}
7375
}
7476

0 commit comments

Comments
 (0)