Package org.openqa.selenium.firefox

Examples of org.openqa.selenium.firefox.FirefoxDriver$LazyCommandExecutor


  public static void start() throws Exception {
    //Move mouse out of the way so it can't mess about with hover events
    Robot mouseRemover = new Robot();
    mouseRemover.mouseMove(1200, 0);
    localWebServer = new JettyServer(webServerPort);
    driver = new FirefoxDriver();
    driver.manage().window().setSize(new Dimension(1024, 768));
  }
View Full Code Here


            /**
             * Set the selenium driver as local (webdriver instance)
             */
            public void setLocalDriver() {
                switch (this.desc) {
                    case "firefox"  : this.driver = new FirefoxDriver();break;
                    case "iexplorer": this.driver = new InternetExplorerDriver();break;
                    case "chrome"   : this.driver = new ChromeDriver();break;
                    case "opera"    : this.driver = new OperaDriver();break;
                    case "htmlunit" : this.driver = new HtmlUnitDriver();break;
                }
View Full Code Here

        return GalenConfig.getConfig().getBooleanProperty("galen.browserFactory.selenium.runInGrid", false);
    }

    private Browser createLocalBrowser() {
        if (FIREFOX.equals(browserType)) {
            return new SeleniumBrowser(new FirefoxDriver());
        }
        else if (CHROME.equals(browserType)) {
            return new SeleniumBrowser(new ChromeDriver());
        }
        else if (IE.equals(browserType)) {
View Full Code Here

    private static final Properties EMPTY_PROPERTIES = new Properties();
    WebDriver driver;
   
    @BeforeMethod
    public void createDriver() {
        driver = new FirefoxDriver();
    }
View Full Code Here

public class GalenPageActionRunJavascriptTest {
    private static final String TEST_URL = "file://" + GalenPageActionCheckTest.class.getResource("/html/page-for-js-check.html").getPath();
   
    @Test public void shouldRun_javascriptFile_andPerformActions_onBrowser() throws Exception {
        WebDriver driver = new FirefoxDriver();
        Browser browser = new SeleniumBrowser(driver);
        browser.load(TEST_URL);
       
        WebElement element = driver.findElement(By.id("search-query"));
        assertThat("Search input should not contain any text yet", element.getAttribute("value"), is(""));
       
        GalenPageActionRunJavascript action = new GalenPageActionRunJavascript(getClass().getResource("/scripts/to-run-1.js").getFile());
        action.setJsonArguments("{prefix: 'This was'}");
       
View Full Code Here

    public WebDriver newInstance(DriverOptions driverOptions) {
        DesiredCapabilities caps = DesiredCapabilities.firefox();
        setupProxy(caps, driverOptions);
        caps.merge(driverOptions.getCapabilities());
        setDriverSpecificCapabilities(caps, driverOptions, false);
        FirefoxDriver driver = new FirefoxDriver(caps);
        setInitialWindowSize(driver, driverOptions);
        return driver;
    }
View Full Code Here

public class GalenPageActionInjectJavascriptTest {
    private static final String TEST_URL = "file://" + GalenPageActionCheckTest.class.getResource("/html/page1.html").getPath();
   
    @Test public void shouldInject_javascript() throws IOException {
        WebDriver driver = new FirefoxDriver();
        Browser browser = new SeleniumBrowser(driver);
        browser.load(TEST_URL);
       
        GalenPageActionInjectJavascript action = new GalenPageActionInjectJavascript("/scripts/to-inject-1.js");
        action.execute(new TestReport(), browser, new GalenPageTest(), null);
       
        WebElement element = driver.findElement(By.xpath("//body/injected-tag"));
       
        assertThat("Inject tags text should be", element.getText(), is("Some injected content"));
        browser.quit();
    }
View Full Code Here

   

    @Test public void runsTestSuccessfully_inPredefinedBrowser() throws IOException {
        TestValidationListener validationListener = new TestValidationListener();
       
        WebDriver driver = new FirefoxDriver();
       
        GalenPageActionCheck action = new GalenPageActionCheck()
            .withIncludedTags(asList("mobile"))
            .withSpecs(asList("/html/page.spec"));
       
        Browser browser = new SeleniumBrowser(driver);
        browser.load(TEST_URL);
        browser.changeWindowSize(new Dimension(400, 800));
       
        action.execute(new TestReport(), browser, new GalenPageTest(), validationListener);
       
        driver.quit();
       
        assertThat("Invokations should be", validationListener.getInvokations(), is("<o header>\n" +
                "<SpecHeight header>\n" +
                "<e><msg>\"header\" height is 140px which is not in range of 150 to 185px</msg></e>\n" +
                "</o header>\n" +
View Full Code Here

    }
   
    @Test public void runsTestSuccessfully_andExlcudesSpecifiedTags() throws IOException {
        TestValidationListener validationListener = new TestValidationListener();
       
        WebDriver driver = new FirefoxDriver();
       
        GalenPageActionCheck action = new GalenPageActionCheck()
            .withIncludedTags(asList("mobile"))
            .withExcludedTags(asList("debug"))
            .withSpecs(asList("/html/page-exclusion.spec"));
   
        Browser browser = new SeleniumBrowser(driver);
        browser.load(TEST_URL);
        browser.changeWindowSize(new Dimension(400, 800));
       
        action.execute(new TestReport(), browser, new GalenPageTest(), validationListener);
        driver.quit();
       
        assertThat("Invokations should be", validationListener.getInvokations(), is("<o header>\n" +
                "<SpecHeight header>\n" +
                "<e><msg>\"header\" height is 140px which is not in range of 150 to 170px</msg></e>\n" +
                "</o header>\n" +
View Full Code Here

  private final Map<String, Integer> failedMap = new HashMap<String, Integer>();

  @Before
  public void before() {

    driver = new FirefoxDriver();
  }
View Full Code Here

TOP

Related Classes of org.openqa.selenium.firefox.FirefoxDriver$LazyCommandExecutor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.