Package org.openqa.selenium.remote

Examples of org.openqa.selenium.remote.RemoteWebDriver$RemoteWebDriverOptions


    Thread.sleep(120000);
  }


  private static void openeBay(DesiredCapabilities cap) throws MalformedURLException {
    RemoteWebDriver d = null;
    try {
      System.out.println("starting " + cap);
      d = new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"), cap);
      System.out.println("started " + cap);
      d.get("http://ebay.co.uk");
      System.out.println(d.getCurrentUrl());
    } catch (Exception e){
      System.err.println("ERROR "+cap+" - "+e.getMessage());
    } finally {
      if (d != null) {
        d.quit();
      }
    }
  }
View Full Code Here


  @Override
  public InterfaceImplementation getImplementation(Object value) {
    return new InterfaceImplementation() {

      public Object invoke(ExecuteMethod exec, Object self, Method method, Object... args) {
        RemoteWebDriver driver = (RemoteWebDriver) self;
        WebDriverLikeCommandExecutor executor = new WebDriverLikeCommandExecutor(driver);

        if ("dragFromToForDuration".equals(method.getName())) {
          Point from = (Point) args[0];
          Point to = (Point) args[1];
View Full Code Here

    Thread.sleep(1000);

    cap = SampleApps.ppNQASampleAppCap();
    cap.setCapability(IOSCapabilities.SIMULATOR, true);

    driver = new RemoteWebDriver(getRemoteURL(), cap);
  }
View Full Code Here

      crashButton.click();
    } catch (Exception e) {
      // this is expected since we crashed the app
    }

    driver = new RemoteWebDriver(getRemoteURL(), cap);
  }
View Full Code Here

      // should throw an exception
      crashButton.click();
    } catch (Exception ignored) {
      // this is expected since we crashed the simulator
    }
    driver = new RemoteWebDriver(getRemoteURL(), cap);
  }
View Full Code Here

      crashButton.click();
    } catch (Exception e) {
      // this is expected since we crashed instruments
    }

    driver = new RemoteWebDriver(getRemoteURL(), cap);
  }
View Full Code Here

        waitForRC();

        DesiredCapabilities dc = DesiredCapabilities.htmlUnit();
        dc.setCapability("jenkins.label", "foo");
        WebDriver wd = new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"), dc);

        try {
            wd.get("http://www.google.com/");
            new WebDriverWait(wd, 10).until(ExpectedConditions.presenceOfElementLocated(By.tagName("title")));
        } finally {
            wd.quit();
        }

        dc = DesiredCapabilities.htmlUnit();
        System.out.println("jenkins.label=foolabel");
        dc.setCapability("jenkins.label", "foolabel");
        try {
            WebDriver dr = new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"), dc);
            dr.quit();
        } catch (Exception e) {
            fail(e.getMessage()); // should have passed
        }

        System.out.println("jenkins.nodeName=foo");
        dc = DesiredCapabilities.htmlUnit();
        dc.setCapability("jenkins.nodeName", "foo");
        try {
            WebDriver dr = new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"), dc);
            dr.quit();
        } catch (Exception e) {
            fail(e.getMessage()); // should have passed
        }

        dc.setCapability("jenkins.label", "foolabel");
        System.out.println("jenkins.label=foolabel & jenkins.nodeName=foo");
        try {
            WebDriver dr = new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"), dc);
            dr.quit();
        } catch (Exception e) {
            fail(e.getMessage()); // should have passed
        }

        dc = DesiredCapabilities.htmlUnit();
        dc.setCapability("jenkins.label", "bar");
        System.out.println("jenkins.label=bar");
        try {
            new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"), dc);
            fail("jenkins.label=bar should not return a valid session"); // should have failed
        } catch (Exception e) {

        }
View Full Code Here

      System.out.println("Using Chrome");

      // Use technique here:
      // http://code.google.com/p/selenium/wiki/ChromeDriver
      ChromeDriverService service = startChromeDriverService();
      setDriver(new RemoteWebDriver(service.getUrl(), DesiredCapabilities.chrome()));

      System.out.println(getDriver().toString());
      selenium = new WebDriverBackedSelenium(getDriver(), Config.inst().TEAMMATES_URL);

      /*
       * Chrome hack. Currently Chrome doesn't support confirm() yet. http://code.google.com/p/selenium/issues/detail?id=27
       */
      JavascriptExecutor js = (JavascriptExecutor) getDriver();
      js.executeScript("window.confirm = function(msg){ return true;};");

    } else {

      System.out.println("Using " + Config.inst().BROWSER);

      // iexplore, opera, safari. For some not-supported-yet browsers, we
      // use
      // legacy methods: Going through the RC server.
      String selBrowserIdentifierString = "*" + Config.inst().BROWSER;

      selenium = new DefaultSelenium("localhost", 4444, selBrowserIdentifierString, Config.inst().TEAMMATES_URL);
      CommandExecutor executor = new SeleneseCommandExecutor(selenium);
      DesiredCapabilities dc = new DesiredCapabilities();
      setDriver(new RemoteWebDriver(executor, dc));

    }

    selenium.windowMaximize();
    selenium.open("/");
View Full Code Here

      System.out.println("Using Chrome");

      // Use technique here:
      // http://code.google.com/p/selenium/wiki/ChromeDriver
      ChromeDriverService service = startChromeDriverService();
      driver = new RemoteWebDriver(service.getUrl(), DesiredCapabilities.chrome());

      System.out.println(driver.toString());
      selenium = new WebDriverBackedSelenium(driver, Config.inst().TEAMMATES_URL);

      /*
       * Chrome hack. Currently Chrome doesn't support confirm() yet. http://code.google.com/p/selenium/issues/detail?id=27
       */
      JavascriptExecutor js = (JavascriptExecutor) driver;
      js.executeScript("window.confirm = function(msg){ return true;};");

    } else {

      System.out.println("Using " + Config.inst().BROWSER);

      // iexplore, opera, safari. For some not-supported-yet browsers, we
      // use
      // legacy methods: Going through the RC server.
      String selBrowserIdentifierString = "*" + Config.inst().BROWSER;

      selenium = new DefaultSelenium("localhost", 4444, selBrowserIdentifierString, Config.inst().TEAMMATES_URL);
      CommandExecutor executor = new SeleneseCommandExecutor(selenium);
      DesiredCapabilities dc = new DesiredCapabilities();
      driver = new RemoteWebDriver(executor, dc);

    }

    selenium.windowMaximize();
    selenium.open("/");
View Full Code Here

      System.out.println("Using Chrome");

      // Use technique here:
      // http://code.google.com/p/selenium/wiki/ChromeDriver
      ChromeDriverService service = startChromeDriverService();
      driver = new RemoteWebDriver(service.getUrl(),
          DesiredCapabilities.chrome());

      System.out.println(driver.toString());
      selenium = new WebDriverBackedSelenium(driver, Config.TEAMMATES_URL);

      /*
       * Chrome hack. Currently Chrome doesn't support confirm() yet.
       * http://code.google.com/p/selenium/issues/detail?id=27
       */
      JavascriptExecutor js = (JavascriptExecutor) driver;
      js.executeScript("window.confirm = function(msg){ return true;};");

    } else {

      System.out.println("Using " + Config.BROWSER);

      // iexplore, opera, safari. For some not-supported-yet browsers, we use
      // legacy methods: Going through the RC server.
      String selBrowserIdentifierString = "*" + Config.BROWSER;

      selenium = new DefaultSelenium("localhost", 4444,
          selBrowserIdentifierString, Config.TEAMMATES_URL);
      CommandExecutor executor = new SeleneseCommandExecutor(selenium);
      DesiredCapabilities dc = new DesiredCapabilities();
      driver = new RemoteWebDriver(executor, dc);

    }

    selenium.windowMaximize();
    selenium.open("/");
View Full Code Here

TOP

Related Classes of org.openqa.selenium.remote.RemoteWebDriver$RemoteWebDriverOptions

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.