Beispiel #1
0
  @Ignore(value = {SELENESE, IPHONE})
  public void testReadALargeAmountOfData() {
    driver.get(GlobalTestEnvironment.get().getAppServer().whereIs("macbeth.html"));
    String source = driver.getPageSource().trim().toLowerCase();

    assertThat(source.endsWith("</html>"), is(true));
  }
Beispiel #2
0
  private String getUrl() throws MalformedURLException {
    AppServer appServer = GlobalTestEnvironment.get().getAppServer();
    URL url = new URL(appServer.whereIs("/selenium-server/tests/html/basicAuth/index.html"));

    return String.format(
        "%s://alice:foo@%s:%d%s", url.getProtocol(), url.getHost(), url.getPort(), url.getFile());
  }
  @Test
  public void canBlockInvalidSslCertificates() {
    FirefoxProfile profile = new FirefoxProfile();
    profile.setAcceptUntrustedCertificates(false);
    String url = GlobalTestEnvironment.get().getAppServer().whereIsSecure("simpleTest.html");

    WebDriver secondDriver = null;
    try {
      secondDriver = newFirefoxDriver(profile);
      secondDriver.get(url);
      String gotTitle = secondDriver.getTitle();
      assertFalse("Hello WebDriver".equals(gotTitle));
    } catch (Exception e) {
      e.printStackTrace();
      fail("Creating driver with untrusted certificates set to false failed.");
    } finally {
      if (secondDriver != null) {
        secondDriver.quit();
      }
    }
  }