Package org.openqa.selenium

Examples of org.openqa.selenium.JavascriptExecutor


     * clickable at point due to the change coordinate of element in page.
     *
     * @param locator
     */
    public void clickLinkAfterAnimation(By locator) {
        JavascriptExecutor executor = (JavascriptExecutor) getDriver();
        executor.executeScript("arguments[0].click();", getDriver()
                .findElement(locator));
    }
View Full Code Here


        executor.executeScript("arguments[0].click();", getDriver()
                .findElement(locator));
    }

    public void clickLinkAfterAnimation(WebElement element) {
        JavascriptExecutor executor = (JavascriptExecutor) getDriver();
        executor.executeScript("arguments[0].click();", element);
    }
View Full Code Here

   *             when javascript execution failed.
   */
  @Override
  public Object executeJavaScript(String code) throws CrawljaxException {
    try {
      JavascriptExecutor js = (JavascriptExecutor) browser;
      return js.executeScript(code);
    } catch (WebDriverException e) {
      throwIfConnectionException(e);
      throw new CrawljaxException(e);
    }
  }
View Full Code Here

        ((JavascriptExecutor) driver).executeScript(loggingJS);
    }

    @Override
    protected void succeeded(Description description) {
        JavascriptExecutor executor = (JavascriptExecutor) driver;
        assertEquals("Should be no errors in javascript",
                executor.executeScript("return window.allureErrors.length"), 0L);
    }
View Full Code Here

   *             when javascript execution failed.
   */
  @Override
  public Object executeJavaScript(String code) throws CrawljaxException {
    try {
      JavascriptExecutor js = (JavascriptExecutor) browser;
      return js.executeScript(code);
    } catch (WebDriverException e) {
      throwIfConnectionException(e);
      throw new CrawljaxException(e);
    }
  }
View Full Code Here

     *
     * Note that this method is similar to AuraUITestingUtil's findGlobalIdForComponentWithGivenProperties() and
     * getEval() methods, but these tests must be run in DEV mode where $A.test is not supported.
     */
    public void clickButtonByLocalId(String localId) {
        JavascriptExecutor jsExecutor = (JavascriptExecutor) testCase.getDriver();
        String query = "var cmp = $A.getQueryStatement().from('component').field('globalId').field('localId')"
                + ".where(\"localId === '" + localId + "'\").query();return cmp.rows[0].globalId";
        String globalId = jsExecutor.executeScript(query).toString();
        jsExecutor.executeScript("$A.getCmp(\"" + globalId + "\").get('e.press').fire()");
    }
View Full Code Here

   *             when javascript execution failed.
   */
  @Override
  public Object executeJavaScript(String code) throws CrawljaxException {
    try {
      JavascriptExecutor js = (JavascriptExecutor) browser;
      return js.executeScript(code);
    } catch (WebDriverException e) {
      throwIfConnectionException(e);
      throw new CrawljaxException(e);
    }
  }
View Full Code Here

        }

        private void waitForLoad(WebDriver driver)
        {
            if (JavascriptExecutor.class.isInstance(driver)) {
                JavascriptExecutor executor = (JavascriptExecutor) driver;
                executor.executeAsyncScript("var callback = arguments[arguments.length - 1];" +
                    "var el = document.querySelector('body');" +
                    "if (window.angular) {" +
                    "angular.element(el).injector().get('$browser').notifyWhenNoOutstandingRequests(callback);" +
                    "} else {callback()}");
            }
View Full Code Here

   *             when javascript execution failed.
   */
  @Override
  public Object executeJavaScript(String code) throws CrawljaxException {
    try {
      JavascriptExecutor js = (JavascriptExecutor) browser;
      return js.executeScript(code);
    } catch (WebDriverException e) {
      throwIfConnectionException(e);
      throw new CrawljaxException(e);
    }
  }
View Full Code Here

            waitForLoad(driver);
        }

        private void waitForLoad(WebDriver driver) {
            if (JavascriptExecutor.class.isInstance(driver)) {
                JavascriptExecutor executor = (JavascriptExecutor) driver;
                executor.executeAsyncScript(
                        "var callback = arguments[arguments.length - 1];" +
                        "var e1 = document.querySelector('body');" +
                        "if (window.angular) {" +
                            "angular.element(e1).injector().get('$browser').notifyWhenNoOutstandingRequests(callback);" +
                        "} else {callback()}"
View Full Code Here

TOP

Related Classes of org.openqa.selenium.JavascriptExecutor

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.