Search in sources :

Example 11 with ChromeDriver

use of org.openqa.selenium.chrome.ChromeDriver in project java.webdriver by sayems.

the class GetTitle method main.

public static void main(String[] args) {
    WebDriver driver = new ChromeDriver();
    driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
    driver.navigate().to("http://www.google.com");
    JavascriptExecutor js = (JavascriptExecutor) driver;
    System.out.println(js.executeScript("return document.title"));
}
Also used : WebDriver(org.openqa.selenium.WebDriver) JavascriptExecutor(org.openqa.selenium.JavascriptExecutor) ChromeDriver(org.openqa.selenium.chrome.ChromeDriver)

Example 12 with ChromeDriver

use of org.openqa.selenium.chrome.ChromeDriver in project java.webdriver by sayems.

the class ScrollUpDown method main.

public static void main(String[] args) {
    WebDriver driver = new ChromeDriver();
    driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
    driver.navigate().to("http://www.google.com");
    JavascriptExecutor js = (JavascriptExecutor) driver;
    // Scroll up
    js.executeScript("scroll(250, 0)");
    // Scroll down
    js.executeScript("window.scrollBy(0,250)", "");
}
Also used : WebDriver(org.openqa.selenium.WebDriver) JavascriptExecutor(org.openqa.selenium.JavascriptExecutor) ChromeDriver(org.openqa.selenium.chrome.ChromeDriver)

Example 13 with ChromeDriver

use of org.openqa.selenium.chrome.ChromeDriver in project BuildRadiator by BuildRadiator.

the class RadiatorWebDriverTest method sharedForAllTests.

@BeforeClass
public static void sharedForAllTests() {
    // Keep the WebDriver browser window open between tests
    DRIVER = new ChromeDriver();
    FWD = new FluentWebDriver(DRIVER);
}
Also used : FluentWebDriver(org.seleniumhq.selenium.fluent.FluentWebDriver) ChromeDriver(org.openqa.selenium.chrome.ChromeDriver)

Aggregations

ChromeDriver (org.openqa.selenium.chrome.ChromeDriver)13 WebDriver (org.openqa.selenium.WebDriver)7 JavascriptExecutor (org.openqa.selenium.JavascriptExecutor)4 FirefoxDriver (org.openqa.selenium.firefox.FirefoxDriver)4 File (java.io.File)3 URL (java.net.URL)3 DesiredCapabilities (org.openqa.selenium.remote.DesiredCapabilities)3 IOException (java.io.IOException)2 PhantomJSDriver (org.openqa.selenium.phantomjs.PhantomJSDriver)2 RemoteWebDriver (org.openqa.selenium.remote.RemoteWebDriver)2 PublicAtsApi (com.axway.ats.common.PublicAtsApi)1 LocalProcessExecutor (com.axway.ats.core.process.LocalProcessExecutor)1 IProcessExecutor (com.axway.ats.core.process.model.IProcessExecutor)1 AbstractRealBrowserDriver (com.axway.ats.uiengine.AbstractRealBrowserDriver)1 RobotException (com.axway.ats.uiengine.exceptions.RobotException)1 FileNotFoundException (java.io.FileNotFoundException)1 FileOutputStream (java.io.FileOutputStream)1 FileReader (java.io.FileReader)1 InputStream (java.io.InputStream)1 OutputStream (java.io.OutputStream)1