Package jp.vmi.selenium.webdriver

Examples of jp.vmi.selenium.webdriver.WebDriverManager$Builder


    /**
     * Initialize.
     */
    @Before
    public void initialize() {
        WebDriverManager manager = WebDriverManager.getInstance();
        manager.setWebDriverFactory(WebDriverManager.HTMLUNIT);
        manager.setDriverOptions(new DriverOptions());
        runner.setDriver(manager.get());
    }
View Full Code Here


     * Test of "TestSuiteTest.html".
     */
    @Test
    public void testTestSuite() {
        String script = TestUtils.getScriptFile("testSuite");
        WebDriverManager manager = WebDriverManager.getInstance();
        manager.setWebDriverFactory(WebDriverManager.HTMLUNIT);
        manager.setDriverOptions(new DriverOptions());
        Runner runner = new Runner();
        runner.setDriver(manager.get());
        runner.setOverridingBaseURL(wsr.getBaseURL());
        runner.run(script);
    }
View Full Code Here

    public void generateHtmlResult() throws Exception {
        File root = getTmpRoot();
        new File(root, "html").mkdir();
        new File(root, "img").mkdir();
        Runner runner = new Runner();
        WebDriverManager wdm = WebDriverManager.getInstance();
        wdm.setWebDriverFactory(WebDriverManager.PHANTOMJS);
        WebDriver driver = null;
        try {
            driver = wdm.get();
        } catch (RuntimeException e) {
            Assume.assumeNoException(e);
        }
        runner.setDriver(driver);
        runner.setHtmlResultDir(new File(root, "html").getPath());
View Full Code Here

        }
    };

    @Override
    protected void initDriver() {
        WebDriverManager manager = WebDriverManager.getInstance();
        manager.setWebDriverFactory(factoryName);
        manager.setDriverOptions(new DriverOptions());
        try {
            driver = manager.get();
        } catch (UnreachableBrowserException e) {
            Assume.assumeNoException(e);
        } catch (UnsupportedOperationException e) {
            Assume.assumeNoException(e);
        }
View Full Code Here

     */
    @SuppressWarnings("deprecation")
    @Test
    public void stringMatchPatternOld() throws IOException {
        Runner runner = new Runner();
        WebDriverManager wdm = WebDriverManager.getInstance();
        wdm.setWebDriverFactory(WebDriverManager.HTMLUNIT);
        wdm.setDriverOptions(new DriverOptions());
        runner.setDriver(wdm.get());
        TestCase testCase = Binder.newTestCase("dummy", "dummy", runner, wsr.getBaseURL());
        CommandFactory commandFactory = runner.getCommandFactory();
        commandFactory.setProc(testCase.getProc());
        testCase.addCommand(commandFactory.newCommand(0, "open", "/assertion.html"));
        testCase.addCommand(commandFactory.newCommand(1, commandName, argument));
View Full Code Here

     *
     * @throws IOException exception.
     */
    @Test
    public void stringMatchPattern() throws IOException {
        WebDriverManager wdm = WebDriverManager.getInstance();
        wdm.setWebDriverFactory(WebDriverManager.HTMLUNIT);
        wdm.setDriverOptions(new DriverOptions());
        Runner runner = new Runner();
        runner.setDriver(wdm.get());
        CommandFactory cf = runner.getCommandFactory();
        TestCase testCase = Binder.newTestCase("dummy", "dummy", wsr.getBaseURL());
        testCase.addCommand(cf, "open", "/assertion.html");
        testCase.addCommand(cf, commandName, argument);
        Result result = runner.execute(testCase);
View Full Code Here

     * @throws IOException exception.
     */
    @Test
    @Ignore("test fail on buildhive....")
    public void userFriendlyErrorMessage() throws IOException {
        WebDriverManager wdm = WebDriverManager.getInstance();
        wdm.setWebDriverFactory(WebDriverManager.HTMLUNIT);
        wdm.setDriverOptions(new DriverOptions());
        Runner runner = new Runner();
        runner.setDriver(wdm.get());
        runner.setOverridingBaseURL(wsr.getBaseURL());
        CommandFactory cf = runner.getCommandFactory();
        TestCase testCase = Binder.newTestCase("dummy", "dummy", wsr.getBaseURL());
        testCase.addCommand(cf, "open", "/index.html");
        testCase.addCommand(cf, "click", "link=linktext");
View Full Code Here

     *
     * @throws IOException exception.
     */
    @Test
    public void userFriendlyAssertionMessage() throws IOException {
        WebDriverManager wdm = WebDriverManager.getInstance();
        wdm.setWebDriverFactory(WebDriverManager.HTMLUNIT);
        wdm.setDriverOptions(new DriverOptions());
        Runner runner = new Runner();
        runner.setDriver(wdm.get());
        runner.setOverridingBaseURL(wsr.getBaseURL());
        CommandFactory cf = runner.getCommandFactory();

        TestCase testCase = Binder.newTestCase("dummy", "dummy", wsr.getBaseURL());
        testCase.addCommand(cf, "open", "/assertion.html");
View Full Code Here

     *
     * @throws IOException exception.
     */
    @Test
    public void test() throws IOException {
        WebDriverManager wdm = WebDriverManager.getInstance();
        wdm.setWebDriverFactory(WebDriverManager.HTMLUNIT);
        wdm.setDriverOptions(new DriverOptions());
        Runner runner = new Runner();
        runner.setDriver(wdm.get());
        CommandFactory cf = runner.getCommandFactory();

        File selenesefile = File.createTempFile("selenese", ".html");
        TestCase testCase = Binder.newTestCase(selenesefile.getPath(), "test", "http://example.co.jp");
        testCase.addCommand(cf, "store", wsr.getBaseURL(), "url");
View Full Code Here

                else if (driverOptions.has(DriverOption.IEDRIVER))
                    driverName = WebDriverManager.IE;
                else if (driverOptions.has(DriverOption.PHANTOMJS))
                    driverName = WebDriverManager.PHANTOMJS;
            }
            WebDriverManager manager = WebDriverManager.getInstance();
            manager.setWebDriverFactory(driverName);
            manager.setDriverOptions(driverOptions);
            Runner runner = new Runner();
            if (cli.hasOption("command-factory")) {
                String factoryName = cli.getOptionValue("command-factory");
                ICommandFactory factory;
                try {
                    Class<?> factoryClass = Class.forName(factoryName);
                    factory = (ICommandFactory) factoryClass.newInstance();
                } catch (Exception e) {
                    e.printStackTrace();
                    throw new IllegalArgumentException("invalid user defined command factory: " + factoryName);
                }
                runner.getCommandFactory().registerCommandFactory(factory);
                log.info("Registered: {}", factoryName);
            }
            runner.setCommandLineArgs(args);
            runner.setDriver(manager.get());
            runner.setWebDriverPreparator(manager);
            runner.setHighlight(cli.hasOption("highlight"));
            runner.setScreenshotDir(cli.getOptionValue("screenshot-dir"));
            runner.setScreenshotAllDir(cli.getOptionValue("screenshot-all"));
            runner.setScreenshotOnFailDir(cli.getOptionValue("screenshot-on-fail"));
View Full Code Here

TOP

Related Classes of jp.vmi.selenium.webdriver.WebDriverManager$Builder

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.