|
3 | 3 | import java.net.URL; |
4 | 4 | import java.util.Arrays; |
5 | 5 | import java.util.concurrent.TimeUnit; |
| 6 | + |
6 | 7 | import org.openqa.selenium.Platform; |
7 | 8 | import org.openqa.selenium.chrome.ChromeOptions; |
8 | 9 | import org.openqa.selenium.remote.DesiredCapabilities; |
|
13 | 14 |
|
14 | 15 | public class test { |
15 | 16 |
|
| 17 | + private static final String VIDEO_URL = null; |
16 | 18 | private RemoteWebDriver driver; |
17 | 19 |
|
18 | 20 | @BeforeMethod(alwaysRun = true) |
19 | 21 | public void beforeMethod() throws Exception { |
20 | 22 |
|
21 | 23 | // Example test environment. NOTE: Gridlastic auto scaling requires all |
22 | 24 | // 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 |
26 | 28 |
|
27 | 29 | // optional video recording |
28 | | - String record_video = "False"; |
| 30 | + String record_video = "True"; |
29 | 31 |
|
30 | 32 | DesiredCapabilities capabilities = new DesiredCapabilities(); |
31 | 33 | if (platform_name.equalsIgnoreCase("win7")) { |
@@ -56,19 +58,19 @@ public void beforeMethod() throws Exception { |
56 | 58 | capabilities.setCapability(ChromeOptions.CAPABILITY, options); |
57 | 59 | } |
58 | 60 |
|
| 61 | + |
| 62 | + |
59 | 63 | driver = new RemoteWebDriver( |
60 | 64 | 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"), |
62 | 66 | capabilities); |
63 | 67 | 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 | + |
67 | 70 |
|
68 | 71 | if (record_video.equalsIgnoreCase("True")) { |
69 | 72 | 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()); |
72 | 74 | } |
73 | 75 | } |
74 | 76 |
|
|
0 commit comments