Example usage for org.openqa.selenium WebDriver getTitle

List of usage examples for org.openqa.selenium WebDriver getTitle

Introduction

In this page you can find the example usage for org.openqa.selenium WebDriver getTitle.

Prototype

String getTitle();

Source Link

Document

Get the title of the current page.

Usage

From source file:uk.q3c.krail.testbench.KrailTestBenchTestCase.java

License:Apache License

@After
public void baseTearDown() {
    System.out.println("closing all drivers");
    for (WebDriver webDriver : drivers) {
        System.out.println("closing web driver: " + webDriver.getTitle() + "");
        webDriver.close();//from w  w w  .j  a va 2s .c  om

    }
    //        if (!drivers.contains(driver)) {
    //            driver.close();//in case it was set directly and not through addDriver
    //        }

    drivers.clear();
}

From source file:without_package.Nw_Class.java

public static void main(String[] args) {
    // TODO Auto-generated method stub
    System.setProperty("webdriver.chrome.driver",
            "C:/Users/m.manchanda/Desktop/Mohit/Selenium/chromedriver_win32/chromedriver.exe");
    WebDriver driver = new ChromeDriver();
    driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
    driver.manage().window().maximize();
    driver.get("https://google.co.in");
    System.out.println(driver.getTitle());
    WebDriverWait wait = new WebDriverWait(driver, 60);

    wait.until(ExpectedConditions.presenceOfElementLocated(By.id("lst-ib")));
    driver.findElement(By.id("lst-ib")).sendKeys("Hi");
    System.out.println(driver.findElement(By.id("lst-ib")).getLocation());
    System.out.println(driver.findElement(By.id("sfdiv")).getLocation());
    /*//w  w w  . j  a v a2 s. c om
    List username = new List();
    username.add("ebizlicensee10@licensee.com");
    username.add("Bablu");
    Iterator<String> itr = new username.iterator();
    itr.next();
    while(itr.hasNext())
    {
       System.out.println(itr.next());
    }
    */
    System.out.println("Success dude");
    driver.quit();
}

From source file:wsattacker.sso.openid.attacker.evaluation.SeleniumBrowser.java

License:Open Source License

private static boolean hasQuit(WebDriver driver) {
    try {//w w w.  ja  v  a  2  s .co  m
        driver.getTitle();
        return false;
    } catch (Exception e) {
        return true;
    }
}