Codota Logo
WebDriver.get
Code IndexAdd Codota to your IDE (free)

How to use
get
method
in
org.openqa.selenium.WebDriver

Best Java code snippets using org.openqa.selenium.WebDriver.get (Showing top 20 results out of 1,449)

Refine searchRefine arrow

  • WebDriver.findElement
  • FirefoxDriver.<init>
  • PrintStream.println
  • WebDriver.manage
  • URL.toString
  • Test.<init>
  • WebElement.click
  • Common ways to obtain WebDriver
private void myMethod () {
WebDriver w =
  • Codota Iconnew FirefoxDriver()
  • Codota Iconnew ChromeDriver()
  • Codota IconCapabilities capabilities;new ChromeDriver(capabilities)
  • Smart code suggestions by Codota
}
origin: apache/geode

@Override
public void before() throws Throwable {
 setUpWebDriver();
 try {
  driver.get(getPulseURL() + "login.html");
 } catch (Exception e) {
  e.printStackTrace();
  System.out.println("before: driver get exception " + e.getMessage());
  throw e;
 }
 if (StringUtils.isNotBlank(username) && StringUtils.isNotBlank(password)) {
  try {
   login();
  } catch (Exception e) {
   e.printStackTrace();
   System.out.println("before: login exception " + e.getMessage());
   throw e;
  }
 }
 driver.navigate().refresh();
}
origin: cloudfoundry/uaa

@Test
public void checkAccessForTotpPage() throws Exception {
  webDriver.get(zoneUrl + "/logout.do");
  webDriver.manage().deleteAllCookies();
  webDriver.get(zoneUrl + "/login/mfa/register");
  assertEquals(zoneUrl + "/login", webDriver.getCurrentUrl());
}
origin: apache/geode

private void login() {
 WebElement userNameElement = waitForElementById("user_name", 60);
 WebElement passwordElement = waitForElementById("user_password");
 userNameElement.sendKeys(username);
 passwordElement.sendKeys(password);
 passwordElement.submit();
 driver.get(getPulseURL() + "clusterDetail.html");
 WebElement userNameOnPulsePage =
   (new WebDriverWait(driver, 30, 1000)).until(
     (ExpectedCondition<WebElement>) d -> d.findElement(By.id("userName")));
 assertNotNull(userNameOnPulsePage);
}
origin: cloudfoundry/uaa

@Test
public void testFrameReportsChangedWhenSameUser_whenLoggedOut() throws UnsupportedEncodingException, InterruptedException {
  webDriver.get(testPage);
  webDriver.findElement(By.id("sameUser")).click();
  assertMessage("unchanged");
}
origin: org.juzu/juzu-core

 @Test
 @RunAsClient
 public void test() throws Exception {
  driver.get(applicationURL().toString());
  System.out.println(driver.getPageSource());
  WebDriverWait wait = new WebDriverWait(driver, 5);
  wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("/html[@bar]")));
  WebElement elt = driver.findElement(By.tagName("html"));
  assertEquals("<bar>foo_value</bar>", elt.getAttribute("bar"));
 }
}
origin: stackoverflow.com

LogEntries logEntries = driver.manage().logs().get(LogType.BROWSER);
for (LogEntry entry : logEntries) {
  System.out.println(new Date(entry.getTimestamp()) + " " + entry.getLevel() + " " + entry.getMessage());
driver.get("http://mypage.com");
origin: stackoverflow.com

WebDriver driver = new FirefoxDriver();
     driver.get("http://www.reddit.com/r/pics/");
     driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
     WebElement element = driver.findElement(By
         .linkText("next ›"));
     element.click();
     System.out.println(driver.getCurrentUrl());
origin: stackoverflow.com

 public void handle(){
WebDriver driver;
driver=new FirefoxDriver();
driver.manage().window().maximize();
driver.get("http://toolsqa.com/automation-practice-switch-windows/");
driver.findElement(By.xpath(".//*[@id='content']/p[4]/button")).click();
ArrayList<String> tabs2 = new ArrayList<String> (driver.getWindowHandles());
driver.switchTo().window(tabs2.get(1));
System.out.println(driver.getTitle());
}
origin: stackoverflow.com

 WebDriver driver = new FirefoxDriver();
driver.get("file://<Path>/div.html");
long starttime = System.currentTimeMillis();
//driver.findElement(By.cssSelector(".class"));
//driver.findElement(By.className("class"));
//driver.findElement(By.cssSelector("#id"));
//driver.findElement(By.id("id"));
//driver.findElement(By.cssSelector("div"));
//driver.findElement(By.tagName("div"));
long stoptime = System.currentTimeMillis();
System.out.println(stoptime-starttime + " milliseconds");
driver.quit();
origin: spring-projects/spring-security

@Test
public void cookies() {
  WebTestClient webTestClient = WebTestClient
    .bindToController(new CookieController())
    .build();
  WebDriver driver = WebTestClientHtmlUnitDriverBuilder
    .webTestClientSetup(webTestClient).build();
  driver.get("http://localhost/cookie");
  assertThat(driver.getPageSource()).contains("theCookie");
  driver.get("http://localhost/cookie/delete");
  assertThat(driver.getPageSource()).contains("null");
}
origin: cloudfoundry/uaa

  @Test
  public void testMethodNotAllowedRoutedToErrorPage() throws Exception {
    webDriver.get(baseUrl + "/authenticate");

    Assert.assertTrue("Check if on the error page", webDriver.findElement(By.tagName("h2")).getText().contains("Uh oh."));
    Assert.assertTrue("Check if on the error page", webDriver.findElement(By.tagName("h2")).getText().contains("Something went amiss."));
  }
}
origin: cloudfoundry/uaa

@Test
public void testCsrfIsResetDuringLoginPageReload() {
  webDriver.get(baseUrl + "/login");
  String csrf1 = webDriver.manage().getCookieNamed(CookieBasedCsrfTokenRepository.DEFAULT_CSRF_COOKIE_NAME).getValue();
  webDriver.get(baseUrl + "/login");
  String csrf2 = webDriver.manage().getCookieNamed(CookieBasedCsrfTokenRepository.DEFAULT_CSRF_COOKIE_NAME).getValue();
  assertNotEquals(csrf1, csrf2);
}
origin: spring-projects/spring-security

@Test
public void defaultLoginPageWithSingleClientRegistrationThenRedirect() {
  this.spring.register(OAuth2LoginWithSingleClientRegistrations.class).autowire();
  WebTestClient webTestClient = WebTestClientBuilder
      .bindToWebFilters(new GitHubWebFilter(), this.springSecurity)
      .build();
  WebDriver driver = WebTestClientHtmlUnitDriverBuilder
      .webTestClientSetup(webTestClient)
      .build();
  driver.get("http://localhost/");
  assertThat(driver.getCurrentUrl()).startsWith("https://github.com/login/oauth/authorize");
}
origin: cloudfoundry/uaa

@Before
@After
public void logout_and_clear_cookies() {
  try {
    webDriver.get(baseUrl + "/logout.do");
  }catch (org.openqa.selenium.TimeoutException x) {
    //try again - this should not be happening - 20 second timeouts
    webDriver.get(baseUrl + "/logout.do");
  }
  webDriver.get(appUrl+"/j_spring_security_logout");
  webDriver.manage().deleteAllCookies();
}
origin: cloudfoundry/uaa

public void performLogin(String idpZoneId, String idpZoneUserEmail, String idpZoneUrl, IdentityZone spZone, String spZoneUrl, SamlIdentityProviderDefinition samlIdentityProviderDefinition) {
    webDriver.get(baseUrl + "/logout.do");
    webDriver.get(spZoneUrl + "/logout.do");
    webDriver.get(idpZoneUrl+ "/logout.do");
    webDriver.get(spZoneUrl + "/");
    assertEquals(spZone.getName(), webDriver.getTitle());
    Cookie beforeLogin = webDriver.manage().getCookieNamed("JSESSIONID");
    assertNotNull(beforeLogin);
    assertNotNull(beforeLogin.getValue());
    assertNotNull(element);
    element.click();
  try {
    webDriver.findElement(By.xpath("//h1[contains(text(), 'Welcome to The Twiglet Zone[" + idpZoneId + "]!')]"));
    webDriver.findElement(By.name("username")).clear();
    webDriver.findElement(By.name("username")).sendKeys(idpZoneUserEmail);
    webDriver.findElement(By.name("password")).sendKeys("secr3T");
    webDriver.findElement(By.xpath("//input[@value='Sign in']")).click();
    assertThat(webDriver.findElement(By.cssSelector("h1")).getText(), containsString("Where to?"));
    Cookie afterLogin = webDriver.manage().getCookieNamed("JSESSIONID");
    assertNotNull(afterLogin);
    assertNotNull(afterLogin.getValue());
origin: cloudfoundry/uaa

  private void login(IdentityProvider<SamlIdentityProviderDefinition> provider) {
    webDriver.get(baseUrl + "/login");
    Assert.assertEquals("Cloud Foundry", webDriver.getTitle());
    webDriver.findElement(By.xpath("//a[text()='" + provider.getConfig().getLinkText() + "']")).click();
    webDriver.findElement(By.xpath("//h2[contains(text(), 'Enter your username and password')]"));
    webDriver.findElement(By.name("username")).clear();
    webDriver.findElement(By.name("username")).sendKeys(testAccounts.getUserName());
    webDriver.findElement(By.name("password")).sendKeys(testAccounts.getPassword());
    webDriver.findElement(By.xpath("//input[@value='Login']")).click();
  }
}
origin: cloudfoundry/uaa

  private void signIn(String userName, String password) {
    webDriver.get(baseUrl + "/logout.do");
    webDriver.get(baseUrl + "/login");
    webDriver.findElement(By.name("username")).sendKeys(userName);
    webDriver.findElement(By.name("password")).sendKeys(password);
    webDriver.findElement(By.xpath("//input[@value='Sign in']")).click();
    assertThat(webDriver.findElement(By.cssSelector("h1")).getText(), containsString("Where to?"));
  }
}
origin: code4craft/webmagic

webDriver.get(request.getUrl());
try {
  Thread.sleep(sleepTime);
  e.printStackTrace();
WebDriver.Options manage = webDriver.manage();
Site site = task.getSite();
if (site.getCookies() != null) {
WebElement webElement = webDriver.findElement(By.xpath("/html"));
String content = webElement.getAttribute("outerHTML");
Page page = new Page();
origin: cloudfoundry/uaa

@Test
public void testFrameReportsChangedWhenDifferentUser_whenLoggedOut() throws UnsupportedEncodingException, InterruptedException {
  webDriver.get(testPage);
  webDriver.findElement(By.id("differentUser")).click();
  assertMessage("changed");
}
origin: juzu/juzu

 @Test
 @RunAsClient
 public void test() throws Exception {
  driver.get(applicationURL().toString());
  System.out.println(driver.getPageSource());
  WebDriverWait wait = new WebDriverWait(driver, 5);
  wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("/html[@bar]")));
  WebElement elt = driver.findElement(By.tagName("html"));
  assertEquals("<bar>foo_value</bar>", elt.getAttribute("bar"));
 }
}
org.openqa.seleniumWebDriverget

Javadoc

Load a new web page in the current browser window. This is done using an HTTP GET operation, and the method will block until the load is complete. This will follow redirects issued either by the server or as a meta-redirect from within the returned HTML. Should a meta-redirect "rest" for any duration of time, it is best to wait until this timeout is over, since should the underlying page change whilst your test is executing the results of future calls against this interface will be against the freshly loaded page. Synonym for org.openqa.selenium.WebDriver.Navigation#to(String).

Popular methods of WebDriver

  • findElement
    Find the first WebElement using the given method. This method is affected by the 'implicit wait' tim
  • manage
    Gets the Option interface
  • quit
    Quits this driver, closing every associated window.
  • findElements
    Find all elements within the current page using the given mechanism. This method is affected by the
  • getCurrentUrl
    Get a string representing the current URL that the browser is looking at.
  • switchTo
    Send future commands to a different frame or window.
  • getPageSource
    Get the source of the last loaded page. If the page has been modified after loading (for example, by
  • getTitle
    The title of the current page.
  • navigate
    An abstraction allowing the driver to access the browser's history and to navigate to a given URL.
  • close
    Close the current window, quitting the browser if it's the last window currently open.
  • getWindowHandles
    Return a set of window handles which can be used to iterate over all open windows of this WebDriver
  • getWindowHandle
    Return an opaque handle to this window that uniquely identifies it within this driver instance. This
  • getWindowHandles,
  • getWindowHandle,
  • <init>,
  • Close,
  • find_element,
  • findelement,
  • load,
  • navigateTo,
  • toString

Popular in Java

  • Start an intent from android
  • findViewById (Activity)
  • getSharedPreferences (Context)
  • getContentResolver (Context)
  • FileInputStream (java.io)
    A FileInputStream obtains input bytes from a file in a file system. What files are available depends
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • Locale (java.util)
    A Locale object represents a specific geographical, political, or cultural region. An operation that
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now