當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。