org.openqa.selenium.remote.RemoteWebDriver.get()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(6.9k)|赞(0)|评价(0)|浏览(191)

本文整理了Java中org.openqa.selenium.remote.RemoteWebDriver.get方法的一些代码示例,展示了RemoteWebDriver.get的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RemoteWebDriver.get方法的具体详情如下:
包路径:org.openqa.selenium.remote.RemoteWebDriver
类名称:RemoteWebDriver
方法名:get

RemoteWebDriver.get介绍

暂无

代码示例

代码示例来源:origin: testcontainers/testcontainers-java

@Test
  public void testContainerRunningAgainstExposedHostPort() {
    // useHostExposedPort {
    final String rootUrl =
      String.format("http://host.testcontainers.internal:%d/", localServerPort);

    final RemoteWebDriver webDriver = browser.getWebDriver();
    webDriver.get(rootUrl);
    // }

    final String pageSource = webDriver.getPageSource();
    assertTrue(pageSource.contains("Hello World!"));
  }
}

代码示例来源:origin: testcontainers/testcontainers-java

@Test
  public void testConnection() {
    RemoteWebDriver driver = chrome.getWebDriver();

    // Construct a URL that the browser container can access
    String hostIpAddress = chrome.getTestHostIpAddress();
    driver.get("http://" + hostIpAddress + ":" + localPort);

    String headingText = driver.findElement(By.cssSelector("h1")).getText().trim();

    assertEquals("The hardcoded success message was found on a page fetched from a local server", "It worked", headingText);
  }
}

代码示例来源:origin: bonigarcia/mastering-junit5

@Test
void testWithRemoteChrome(
    @DriverUrl("http://localhost:4444/wd/hub") @DriverCapabilities({
        "browserName=chrome",
        "version=59" }) RemoteWebDriver remoteChrome) {
  remoteChrome.get("https://bonigarcia.github.io/selenium-jupiter/");
  assertTrue(remoteChrome.getTitle().contains("JUnit 5 extension"));
}

代码示例来源:origin: testcontainers/testcontainers-java

@Test
  public void testWebDriverToNginxContainerAccessViaContainerLink() {
    RemoteWebDriver driver = chrome.getWebDriver();

    driver.get("http://nginx/");

    assertEquals("Using selenium, an HTTP GET from the nginx server returns the index.html from the custom content directory", "This worked", driver.findElement(By.tagName("body")).getText());
  }
}

代码示例来源:origin: bonigarcia/mastering-junit5

@Test
void testWithRemoteChrome(
    @DriverUrl("http://localhost:4444/wd/hub") @DriverCapabilities({
        "browserName=chrome",
        "version=59" }) RemoteWebDriver remoteChrome) {
  remoteChrome.get("https://bonigarcia.github.io/selenium-jupiter/");
  assertTrue(remoteChrome.getTitle().contains("JUnit 5 extension"));
}

代码示例来源:origin: testcontainers/testcontainers-java

protected void doSimpleWebdriverTest(BrowserWebDriverContainer rule) {
  RemoteWebDriver driver = setupDriverFromRule(rule);
  System.out.println("Selenium remote URL is: " + rule.getSeleniumAddress());
  System.out.println("VNC URL is: " + rule.getVncAddress());
  driver.get("http://www.google.com");
  WebElement search = driver.findElement(By.name("q"));
  search.sendKeys("testcontainers");
  search.submit();
  List<WebElement> results = new WebDriverWait(driver, 15)
    .until(ExpectedConditions.visibilityOfAllElementsLocatedBy(By.cssSelector("#search h3")));
  assertTrue("the word 'testcontainers' appears in search results",
    results.stream()
      .anyMatch(el -> el.getText().contains("testcontainers")));
}

代码示例来源:origin: testcontainers/testcontainers-java

protected static void doSimpleExplore(BrowserWebDriverContainer rule) {
  RemoteWebDriver driver = setupDriverFromRule(rule);
  driver.get("http://en.wikipedia.org/wiki/Randomness");
  // Oh! The irony!
  assertTrue("Randomness' description has the word 'pattern'", driver.findElementByPartialLinkText("pattern").isDisplayed());
}

代码示例来源:origin: la-team/light-admin

@Override
public void get(final String url) {
  webDriver.get(url);
}

代码示例来源:origin: testcontainers/testcontainers-java

@Test @Ignore
  public void testCreationOfManyContainers() {
    for (int i = 0; i < 50; i++) {
      BrowserWebDriverContainer container = new BrowserWebDriverContainer()
          .withCapabilities(new ChromeOptions())
          .withRecordingMode(BrowserWebDriverContainer.VncRecordingMode.RECORD_FAILING, new File("build"));

      container.start();
      RemoteWebDriver driver = container.getWebDriver();

      driver.get("http://www.google.com");

      container.stop();
    }
  }
}

代码示例来源:origin: com.github.becausetesting/commons

/**
 * @Title: visitPage @Description: TODO @author
 *         ahu@greendotcorp.com @param @param params1 @return void return
 *         type @throws
 */
public void visitPage(String params1) {
  driver = SeleniumCore.driver;
  driver.get(params1);
}

代码示例来源:origin: org.xwiki.platform/xwiki-platform-test-ui

@Override
public void get(String s)
{
  this.wrappedDriver.get(s);
}

代码示例来源:origin: org.eclipse.che.selenium/che-selenium-core

@Override
public void get(String url) {
 driver.get(url);
}

代码示例来源:origin: com.github.becauseQA/becauseQA-utils

public void to(String url) {
 get(url);
}

代码示例来源:origin: paypal/SeLion

/**
 * Helper method to load a URL in a browser. Can be used for browsers in the case of {@link WebTest} and
 * {@link MobileTest}
 * 
 * @param url
 *            The url of the web application that needs to be opened.
 */
public static void open(String url) {
  Grid.driver().get(url);
}

代码示例来源:origin: com.applitools/eyes-selenium-java3

public void get(String s) {
  frameChain.clear();
  driver.get(s);
}

代码示例来源:origin: iainrose/page-objects

@BeforeMethod(alwaysRun = true)
public void loadWebApplication() {
  driver.get(WEB_SERVER);
}

代码示例来源:origin: te-con/ehour

public static void loadReportSection() {
  Driver.get(BASE_URL + "/eh/report");
}

代码示例来源:origin: com.saucelabs/sebuilder-interpreter

@Override
  public boolean run(TestRun ctx) {
    ctx.driver().get(ctx.string("url"));
    return true;
  }
}

代码示例来源:origin: te-con/ehour

private static void createCustomer(ItCustomer customer, boolean active) {
  Driver.get(BASE_URL + "/eh/admin/client");
  findElement("tabs_panel_border_greySquaredFrame_border__body_customerForm_customer.name").clear();
  findElement("tabs_panel_border_greySquaredFrame_border__body_customerForm_customer.name").sendKeys(customer.name);
  findElement("tabs_panel_border_greySquaredFrame_border__body_customerForm_customer.code").clear();
  findElement("tabs_panel_border_greySquaredFrame_border__body_customerForm_customer.code").sendKeys(customer.code);
  if (!active) {
    findElement("tabs_panel_border_greySquaredFrame_border__body_customerForm_customer.active").click();
  }
  findElement("tabs_panel_border_greySquaredFrame_border__body_customerForm_submitButton").click();
  assertTrue(findElement("tabs_panel_border_greySquaredFrame_border__body_customerForm_serverMessage").getText().matches("^[\\s\\S]*Data saved[\\s\\S]*$"));
}

代码示例来源:origin: te-con/ehour

public static void login(ItUser user) {
  Driver.manage().deleteAllCookies();
  Driver.get(BASE_URL + "/eh/login");
  findElement(WicketBy.wicketPath("loginform_username")).clear();
  findElement(WicketBy.wicketPath("loginform_username")).sendKeys(user.name);
  findElement(WicketBy.wicketPath("loginform_password")).sendKeys(user.password);
  findElement(By.id("loginSubmit")).click();
  assertTrue(findElement(By.cssSelector("BODY")).getText().matches("^[\\s\\S]*Signed in as[\\s\\S]*$"));
}

相关文章