Search in sources :

Example 1 with RemoteWebDriver

use of org.openqa.selenium.remote.RemoteWebDriver in project android by owncloud.

the class Common method takeScreenShotOnFailed.

protected void takeScreenShotOnFailed(String testName) throws IOException {
    File file = ((RemoteWebDriver) driver).getScreenshotAs(OutputType.FILE);
    SimpleDateFormat dt1 = new SimpleDateFormat("yyyy-MM-dd");
    Date today = Calendar.getInstance().getTime();
    String screenShotName = "ScreenShots/" + dt1.format(today) + "/" + testName + ".png";
    FileUtils.copyFile(file, new File(screenShotName));
}
Also used : RemoteWebDriver(org.openqa.selenium.remote.RemoteWebDriver) File(java.io.File) SimpleDateFormat(java.text.SimpleDateFormat) Date(java.util.Date)

Example 2 with RemoteWebDriver

use of org.openqa.selenium.remote.RemoteWebDriver in project Asqatasun by Asqatasun.

the class FirefoxDriverFactory method make.

/**
     * 
     * @param config
     * @return A FirefoxDriver.
     */
@Override
public RemoteWebDriver make(HashMap<String, String> config) {
    FirefoxBinary ffBinary = new FirefoxBinary();
    if (System.getProperty(DISPLAY_PROPERTY) != null) {
        ffBinary.setEnvironmentProperty(DISPLAY_PROPERTY.toUpperCase(), System.getProperty(DISPLAY_PROPERTY));
    } else if (System.getenv(DISPLAY_PROPERTY.toUpperCase()) != null) {
        ffBinary.setEnvironmentProperty(DISPLAY_PROPERTY.toUpperCase(), System.getenv(DISPLAY_PROPERTY.toUpperCase()));
    }
    RemoteWebDriver remoteWebDriver = new FirefoxDriver(ffBinary, firefoxProfile);
    if (screenHeight != -1 && screenWidth != -1) {
        remoteWebDriver.manage().window().setSize(new Dimension(screenWidth, screenHeight));
    }
    return remoteWebDriver;
}
Also used : FirefoxDriver(org.openqa.selenium.firefox.FirefoxDriver) FirefoxBinary(org.openqa.selenium.firefox.FirefoxBinary) RemoteWebDriver(org.openqa.selenium.remote.RemoteWebDriver) Dimension(org.openqa.selenium.Dimension)

Example 3 with RemoteWebDriver

use of org.openqa.selenium.remote.RemoteWebDriver in project rstudio by rstudio.

the class RStudioWebAppDriver method start.

public static WebDriver start() throws Exception {
    driver_ = new RemoteWebDriver(new URL("http://localhost:9515/"), DesiredCapabilities.chrome());
    driver_.get("http://localhost:4011/");
    return driver_;
}
Also used : RemoteWebDriver(org.openqa.selenium.remote.RemoteWebDriver) URL(java.net.URL)

Example 4 with RemoteWebDriver

use of org.openqa.selenium.remote.RemoteWebDriver in project getting-started-java by GoogleCloudPlatform.

the class UserJourneyTestIT method setup.

@Before
public void setup() {
    driver = new RemoteWebDriver(service.getUrl(), DesiredCapabilities.chrome());
    filePath = this.getClass().getResource(IMAGE_FILENAME).getPath();
}
Also used : RemoteWebDriver(org.openqa.selenium.remote.RemoteWebDriver) Before(org.junit.Before)

Example 5 with RemoteWebDriver

use of org.openqa.selenium.remote.RemoteWebDriver in project android by nextcloud.

the class Common method takeScreenShotOnFailed.

protected void takeScreenShotOnFailed(String testName) throws IOException {
    File file = ((RemoteWebDriver) driver).getScreenshotAs(OutputType.FILE);
    SimpleDateFormat dt1 = new SimpleDateFormat("yyyy-MM-dd");
    Date today = Calendar.getInstance().getTime();
    String screenShotName = "ScreenShots/" + dt1.format(today) + "/" + testName + ".png";
    FileUtils.copyFile(file, new File(screenShotName));
}
Also used : RemoteWebDriver(org.openqa.selenium.remote.RemoteWebDriver) File(java.io.File) SimpleDateFormat(java.text.SimpleDateFormat) Date(java.util.Date)

Aggregations

RemoteWebDriver (org.openqa.selenium.remote.RemoteWebDriver)87 URL (java.net.URL)37 Test (org.junit.Test)30 DesiredCapabilities (org.openqa.selenium.remote.DesiredCapabilities)29 File (java.io.File)14 ChromeDriver (org.openqa.selenium.chrome.ChromeDriver)13 ChromeOptions (org.openqa.selenium.chrome.ChromeOptions)12 FirefoxDriver (org.openqa.selenium.firefox.FirefoxDriver)12 MalformedURLException (java.net.MalformedURLException)11 IOException (java.io.IOException)9 WebDriver (org.openqa.selenium.WebDriver)9 Dimension (org.openqa.selenium.Dimension)8 InternetExplorerDriver (org.openqa.selenium.ie.InternetExplorerDriver)7 PhantomJSDriver (org.openqa.selenium.phantomjs.PhantomJSDriver)7 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)7 FirefoxProfile (org.openqa.selenium.firefox.FirefoxProfile)6 HashMap (java.util.HashMap)5 Before (org.junit.Before)5 SafariDriver (org.openqa.selenium.safari.SafariDriver)5 FirefoxOptions (org.openqa.selenium.firefox.FirefoxOptions)4