Package org.openqa.selenium.phantomjs

Examples of org.openqa.selenium.phantomjs.PhantomJSDriver


            options.addArguments("--test-type ");
            driver = new ChromeDriver(options);
        } else if (BrowserUtil.isSafari(desiredCapabilities)) {
            driver = new SafariDriver();
        } else if (BrowserUtil.isPhantomJS(desiredCapabilities)) {
            driver = new PhantomJSDriver();
        } else {
            throw new RuntimeException(
                    "Not implemented support for running locally on "
                            + BrowserUtil
                                    .getBrowserIdentifier(desiredCapabilities));
View Full Code Here


        Map<String, List<String>> qunitSuiteNameTestsHM = new LinkedHashMap<String, List<String>>();

        final TestMethod[] qunitTestMethods = suite.getTestMethods();
        if (!ArrayUtils.isEmpty(qunitTestMethods)) {

            PhantomJSDriver driver = new PhantomJSDriver(ResolvingPhantomJSDriverService.createDefaultService(),
                    DesiredCapabilities.phantomjs());

            for (TestMethod method : qunitTestMethods) {
                if (!StringUtils.isEmpty(method.getQUnitTestSuiteFilePath())) {

                    qunitSuiteNameTestsHM.put(method.getQUnitTestSuiteFilePath(), new ArrayList<String>());

                    final String qunitTestFilePath = (new StringBuilder()).append(QUnitConstants.TMP_FOLDER).append("/")
                            .append(archive.getName()).append("/").append(method.getQUnitTestSuiteFilePath()).toString();

                    URL url = new File(qunitTestFilePath).toURI().toURL();

                    driver.get(url.toExternalForm());

                    @SuppressWarnings("unchecked")
                    List<String> qunitTestList = (List<String>) driver.executeScript("return window.arquillianQUnitTests");

                    if (!CollectionUtils.isEmpty(qunitTestList)) {

                        for (String moduleTestNameStr : qunitTestList) {
View Full Code Here

    } else if (OPERA.equalsIgnoreCase(browser)) {
      return createInstanceOf("com.opera.core.systems.OperaDriver");
    } else if (PHANTOMJS.equals(browser)) {
      DesiredCapabilities capabilities = new DesiredCapabilities();
      capabilities.setJavascriptEnabled(true);
      return new PhantomJSDriver(capabilities);
    } else {
      return createInstanceOf(browser);
    }
  }
View Full Code Here

      final String proxyTypeCap = "--proxy-type=http";
      final String[] args = new String[] { proxyAddrCap, proxyTypeCap };
      caps.setCapability(PhantomJSDriverService.PHANTOMJS_CLI_ARGS, args);
    }
   
    PhantomJSDriver phantomJsDriver = new PhantomJSDriver(caps);

    return WebDriverBackedEmbeddedBrowser.withDriver(phantomJsDriver, filterAttributes,
            crawlWaitEvent, crawlWaitReload);
  }
View Full Code Here

            }
            cliArgs = ArrayUtils.addAll((String[]) cliArgs, driverOptions.getCliArgs());
            caps.setCapability(PHANTOMJS_CLI_ARGS, cliArgs);
        }
        PhantomJSDriverService service = CustomPhantomJSDriverServiceFactory.createDefaultService(caps);
        PhantomJSDriver driver = new PhantomJSDriver(service, caps);
        setInitialWindowSize(driver, driverOptions);
        return driver;
    }
View Full Code Here

    protected InternetExplorerDriver createInternetExplorerDriver() {
        return new InternetExplorerDriver();
    }

    protected WebDriver createPhantomJSDriver() {
        return new PhantomJSDriver();
    }
View Full Code Here

        return driver;
    }

    @Override
    protected void starting(Description description) {
        driver = new PhantomJSDriver(new DesiredCapabilities());
        driver.manage().window().setSize(new Dimension(1024, 768));
        driver.get(environment.getBaseUrl());
        ((JavascriptExecutor) driver).executeScript(loggingJS);
    }
View Full Code Here

      final String proxyTypeCap = "--proxy-type=http";
      final String[] args = new String[] { proxyAddrCap, proxyTypeCap };
      caps.setCapability(PhantomJSDriverService.PHANTOMJS_CLI_ARGS, args);
    }
   
    PhantomJSDriver phantomJsDriver = new PhantomJSDriver(caps);

    return WebDriverBackedEmbeddedBrowser.withDriver(phantomJsDriver, filterAttributes,
            crawlWaitEvent, crawlWaitReload);
  }
View Full Code Here

        break;
      case CHROME:
        driver = new ChromeDriver();
        break;
      case PHANTOMJS:
        driver = new PhantomJSDriver();
        break;
      default:
        throw new IllegalStateException("Unsupported browsertype " + getBrowserType());
    }
View Full Code Here

      final String proxyTypeCap = "--proxy-type=http";
      final String[] args = new String[] { proxyAddrCap, proxyTypeCap };
      caps.setCapability(PhantomJSDriverService.PHANTOMJS_CLI_ARGS, args);
    }
   
    PhantomJSDriver phantomJsDriver = new PhantomJSDriver(caps);

    return WebDriverBackedEmbeddedBrowser.withDriver(phantomJsDriver, filterAttributes,
            crawlWaitEvent, crawlWaitReload);
  }
View Full Code Here

TOP

Related Classes of org.openqa.selenium.phantomjs.PhantomJSDriver

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.