当前位置: 首页>>代码示例>>Java>>正文


Java RemoteWebDriver.get方法代码示例

本文整理汇总了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"));
}
 
开发者ID:bonigarcia,项目名称:mastering-junit5,代码行数:12,代码来源:RemoteWebDriverTest.java

示例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;
}
 
开发者ID:google,项目名称:devtools-driver,代码行数:35,代码来源:ExampleMobileSafariWebTest.java

示例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"));
}
 
开发者ID:bonigarcia,项目名称:selenium-jupiter,代码行数:10,代码来源:DockerFirefoxWithOptionsJupiterTest.java

示例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"));
}
 
开发者ID:bonigarcia,项目名称:selenium-jupiter,代码行数:9,代码来源:DockerChromeWithArgumentsJupiterTest.java

示例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");
}
 
开发者ID:bonigarcia,项目名称:selenium-jupiter,代码行数:10,代码来源:DockerRecordingJupiterTest.java

示例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");
}
 
开发者ID:bonigarcia,项目名称:selenium-jupiter,代码行数:11,代码来源:DockerHtmlVncJupiterTest.java

示例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"));
}
 
开发者ID:bonigarcia,项目名称:selenium-jupiter,代码行数:8,代码来源:DockerChromeLatestJupiterTest.java

示例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"));
}
 
开发者ID:bonigarcia,项目名称:selenium-jupiter,代码行数:8,代码来源:DockerChromeLatestJupiterTest.java

示例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"));
}
 
开发者ID:bonigarcia,项目名称:selenium-jupiter,代码行数:9,代码来源:DockerChromeWithOptionsJupiterTest.java

示例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"));
}
 
开发者ID:bonigarcia,项目名称:selenium-jupiter,代码行数:8,代码来源:DockerChromeJupiterTest.java

示例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"));
}
 
开发者ID:bonigarcia,项目名称:selenium-jupiter,代码行数:8,代码来源:DockerChromeJupiterTest.java

示例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"));
}
 
开发者ID:bonigarcia,项目名称:selenium-jupiter,代码行数:8,代码来源:DockerFirefoxJupiterTest.java

示例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"));
}
 
开发者ID:bonigarcia,项目名称:selenium-jupiter,代码行数:8,代码来源:DockerFirefoxJupiterTest.java

示例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"));
}
 
开发者ID:couchbaselabs,项目名称:GitTalent,代码行数:15,代码来源:GitTalentIntegrationTest.java

示例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"));
}
 
开发者ID:bonigarcia,项目名称:selenium-jupiter,代码行数:7,代码来源:DockerOperaJupiterTest.java


注:本文中的org.openqa.selenium.remote.RemoteWebDriver.get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。