本文整理汇总了Java中org.openqa.selenium.remote.RemoteWebDriver.get方法的典型用法代码示例。如果您正苦于以下问题:Java RemoteWebDriver.get方法的具体用法?Java RemoteWebDriver.get怎么用?Java RemoteWebDriver.get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.openqa.selenium.remote.RemoteWebDriver
的用法示例。
在下文中一共展示了RemoteWebDriver.get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testWithRemoteChrome
import org.openqa.selenium.remote.RemoteWebDriver; //导入方法依赖的package包/类
@Test
void testWithRemoteChrome(
@DriverUrl("http://localhost:4444/wd/hub") @DriverCapabilities(capability = {
@Capability(name = "browserName", value = "chrome"),
@Capability(name = "version", value = "59") }) RemoteWebDriver remoteChrome)
throws InterruptedException {
remoteChrome.get("https://bonigarcia.github.io/selenium-jupiter/");
assertTrue(remoteChrome.getTitle().contains("JUnit 5 extension"));
}
示例2: main
import org.openqa.selenium.remote.RemoteWebDriver; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
// Create a DesiredCapabilities object to request specific devices from the WebDriver server.
// A udid can be optionally specified, otherwise an arbitrary device is chosen.
DesiredCapabilities caps = new DesiredCapabilities();
// caps.setCapability("uuid", udid);
// Start a WebDriver session. The local machine has to be running the SafariDriverServer, or
// change localhost below to an IP running the SafariDriverServer.
driver = new RemoteWebDriver(new URL("http://localhost:5555/wd/hub"), caps);
// Connect to a URL
driver.get("http://www.google.com");
// Interact with the web page. In this example use case, the Webdriver API is used to find
// specific elements, test a google search and take a screenshot.
driver.findElement(By.id("hplogo"));
// Google New York
WebElement mobileSearchBox = driver.findElement(By.id("lst-ib"));
mobileSearchBox.sendKeys("New York");
WebElement searchBox;
try {
searchBox = driver.findElement(By.id("tsbb"));
} catch (NoSuchElementException e) {
searchBox = driver.findElement(By.name("btnG"));
}
searchBox.click();
takeScreenshot();
driver.navigate().refresh();
takeScreenshot();
// Quit the WebDriver instance on completion of the test.
driver.quit();
driver = null;
}
示例3: webrtcTest
import org.openqa.selenium.remote.RemoteWebDriver; //导入方法依赖的package包/类
@Test
public void webrtcTest(@Preferences({
"media.navigator.permission.disabled=true",
"media.navigator.streams.fake=true" }) @DockerBrowser(type = FIREFOX) RemoteWebDriver driver) {
driver.get(
"https://webrtc.github.io/samples/src/content/devices/input-output/");
assertThat(driver.findElement(By.id("video")).getTagName(),
equalTo("video"));
}
示例4: webrtcTest
import org.openqa.selenium.remote.RemoteWebDriver; //导入方法依赖的package包/类
@Test
public void webrtcTest(@Arguments({ "--use-fake-device-for-media-stream",
"--use-fake-ui-for-media-stream" }) @DockerBrowser(type = CHROME) RemoteWebDriver driver) {
driver.get(
"https://webrtc.github.io/samples/src/content/devices/input-output/");
assertThat(driver.findElement(By.id("video")).getTagName(),
equalTo("video"));
}
示例5: testLatest
import org.openqa.selenium.remote.RemoteWebDriver; //导入方法依赖的package包/类
@Test
public void testLatest(
@DockerBrowser(type = CHROME, version = "63.0") RemoteWebDriver driver) {
driver.get("https://bonigarcia.github.io/selenium-jupiter/");
assertThat(driver.getTitle(),
containsString("A JUnit 5 extension for Selenium WebDriver"));
recordingFile = new File("testLatest_arg0_CHROME_63.0_"
+ driver.getSessionId() + ".mp4");
}
示例6: testHtmlVnc
import org.openqa.selenium.remote.RemoteWebDriver; //导入方法依赖的package包/类
@Test
public void testHtmlVnc(
@DockerBrowser(type = CHROME, version = "63.0") RemoteWebDriver driver) {
driver.get("https://bonigarcia.github.io/selenium-jupiter/");
assertThat(driver.getTitle(),
containsString("A JUnit 5 extension for Selenium WebDriver"));
htmlFile = new File("testHtmlVnc_arg0_CHROME_63.0_"
+ driver.getSessionId() + ".html");
}
示例7: testLatestChrome
import org.openqa.selenium.remote.RemoteWebDriver; //导入方法依赖的package包/类
@Test
public void testLatestChrome(
@DockerBrowser(type = CHROME, version = "latest") RemoteWebDriver driver) {
driver.get("https://bonigarcia.github.io/selenium-jupiter/");
assertThat(driver.getTitle(),
containsString("A JUnit 5 extension for Selenium WebDriver"));
}
示例8: testFormerChrome
import org.openqa.selenium.remote.RemoteWebDriver; //导入方法依赖的package包/类
@Test
public void testFormerChrome(
@DockerBrowser(type = CHROME, version = "latest-1") RemoteWebDriver driver) {
driver.get("https://bonigarcia.github.io/selenium-jupiter/");
assertThat(driver.getTitle(),
containsString("A JUnit 5 extension for Selenium WebDriver"));
}
示例9: webrtcTest
import org.openqa.selenium.remote.RemoteWebDriver; //导入方法依赖的package包/类
@Test
public void webrtcTest(
@DockerBrowser(type = CHROME) RemoteWebDriver driver) {
driver.get(
"https://webrtc.github.io/samples/src/content/devices/input-output/");
assertThat(driver.findElement(By.id("video")).getTagName(),
equalTo("video"));
}
示例10: testChrome
import org.openqa.selenium.remote.RemoteWebDriver; //导入方法依赖的package包/类
@Test
public void testChrome(
@DockerBrowser(type = CHROME) RemoteWebDriver driver) {
driver.get("https://bonigarcia.github.io/selenium-jupiter/");
assertThat(driver.getTitle(),
containsString("A JUnit 5 extension for Selenium WebDriver"));
}
示例11: testChromeWithVersion
import org.openqa.selenium.remote.RemoteWebDriver; //导入方法依赖的package包/类
@Test
public void testChromeWithVersion(
@DockerBrowser(type = CHROME, version = "62.0") RemoteWebDriver driver) {
driver.get("https://bonigarcia.github.io/selenium-jupiter/");
assertThat(driver.getTitle(),
containsString("A JUnit 5 extension for Selenium WebDriver"));
}
示例12: testLatest
import org.openqa.selenium.remote.RemoteWebDriver; //导入方法依赖的package包/类
@Test
public void testLatest(
@DockerBrowser(type = FIREFOX) RemoteWebDriver driver) {
driver.get("https://bonigarcia.github.io/selenium-jupiter/");
assertThat(driver.getTitle(),
containsString("A JUnit 5 extension for Selenium WebDriver"));
}
示例13: testVersion
import org.openqa.selenium.remote.RemoteWebDriver; //导入方法依赖的package包/类
@Test
public void testVersion(
@DockerBrowser(type = FIREFOX, version = "56") RemoteWebDriver driver) {
driver.get("https://bonigarcia.github.io/selenium-jupiter/");
assertThat(driver.getTitle(),
containsString("A JUnit 5 extension for Selenium WebDriver"));
}
示例14: testDeveloperTab
import org.openqa.selenium.remote.RemoteWebDriver; //导入方法依赖的package包/类
@Test
public void testDeveloperTab() throws InterruptedException {
RemoteWebDriver driver = chrome.getWebDriver();
driver.get("http://gittalentbackend:8080/githubimport/developer/ldoguin");
driver.get("http://gittalentbackend:8080/githubimport/status");
while(driver.getPageSource().contains("false")) {
Thread.sleep(1000);
driver.navigate().refresh();
};
driver.get("http://gittalentfrontend/");
WebElement myDynamicElement = (new WebDriverWait(driver, 20))
.until(ExpectedConditions.presenceOfElementLocated(By.xpath("/html/body/app-root/div/developers/div[1]/div[2]/div[1]/table/tbody/tr/td[2]")));
Assert.assertTrue(myDynamicElement.getText().equals("ldoguin"));
}
示例15: testOpera
import org.openqa.selenium.remote.RemoteWebDriver; //导入方法依赖的package包/类
@Test
public void testOpera(@DockerBrowser(type = OPERA) RemoteWebDriver driver) {
driver.get("https://bonigarcia.github.io/selenium-jupiter/");
assertThat(driver.getTitle(),
containsString("A JUnit 5 extension for Selenium WebDriver"));
}