-
Notifications
You must be signed in to change notification settings - Fork 7
/
SeleniumGridTest.java
38 lines (30 loc) · 986 Bytes
/
SeleniumGridTest.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package com.thoughtworks.tracing;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxOptions;
import org.openqa.selenium.remote.RemoteWebDriver;
import java.net.MalformedURLException;
import java.net.URL;
public class SeleniumGridTest {
static WebDriver driver;
static String baseURL, nodeURL;
@BeforeAll
public static void setUp() throws MalformedURLException {
baseURL = "https://selenium.dev/";
nodeURL = "http://localhost:4444/";
driver = new RemoteWebDriver(new URL(nodeURL), new FirefoxOptions());
}
@AfterAll
public static void afterTest() {
driver.quit();
}
@Test
public void sampleTest() {
driver.get(baseURL);
driver.findElement(By.tagName("body")).getText();
}
}