-
Notifications
You must be signed in to change notification settings - Fork 0
/
GridTest.java
40 lines (33 loc) · 1.55 KB
/
GridTest.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
39
40
package com.vin.tests;
import java.net.MalformedURLException;
import java.net.URL;
import java.time.Duration;
import io.github.bonigarcia.wdm.WebDriverManager;
import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
import org.openqa.selenium.firefox.FirefoxOptions;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.openqa.selenium.safari.SafariDriver;
import org.openqa.selenium.safari.SafariOptions;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.testng.annotations.Test;
public class GridTest {
@Test
public void RemoteTracingTest() throws MalformedURLException {
System.setProperty("otel.traces.exporter", "jaeger");
System.setProperty("otel.exporter.jaeger.endpoint", "http://localhost:14250");
System.setProperty("otel.resource.attributes", "service.name=selenium-java-client");
URL gridUrl = new URL("http://localhost:4444");
FirefoxOptions firefoxOptions = new FirefoxOptions();
RemoteWebDriver webDriver = new RemoteWebDriver(gridUrl, firefoxOptions);
webDriver.get("http://www.google.com/ncr");
webDriver.findElement(By.name("q")).sendKeys("webdriver", Keys.RETURN);
WebDriverWait webDriverWait = new WebDriverWait(webDriver, Duration.ofSeconds(5));
webDriverWait.until(ExpectedConditions.titleContains("webdriver"));
webDriver.quit();
}
}