Package org.openqa.selenium

Examples of org.openqa.selenium.NoSuchElementException


            @Override
            public Object getTarget() {
                try {
                    return dropProxyAndFindElement(by, searchContext);
                } catch (NoSuchElementException ex) {
                    throw new NoSuchElementException((by instanceof ByIdOrName ? EMPTY_FIND_BY_WARNING : "") + ex.getMessage(),
                            ex);
                }
            }
        });
    }
View Full Code Here


    assertTrue(Cleanup.of.isInvalidSelectorError(new WebDriverException("Invalid selectors: //input[:attr='al]")));
    assertTrue(Cleanup.of.isInvalidSelectorError(new WebDriverException("{\"errorMessage\":\"SYNTAX_ERR: DOM Exception 12\",,\"post\":\"{\\\"using\\\":\\\"css selector\\\",\\\"value\\\":\\\"//input[:attr='al]\\\"}\"}}\n")));
    assertTrue(Cleanup.of.isInvalidSelectorError(new WebDriverException("{\"errorMessage\":\"Unable to locate an element with the xpath expression //xxx[@' because of the following error:\\nError: INVALID_EXPRESSION_ERR: DOM XPath Exception 51\"}}\n")));

    RuntimeException cssException = new RuntimeException("Invalid selectors: //input[:attr='al]");
    NoSuchElementException error = new NoSuchElementException("Unable to locate element using css", cssException);
    assertTrue(Cleanup.of.isInvalidSelectorError(error));
  }
View Full Code Here

       
    }

    @Step
    public void failsToFindElement() {
        throw new NoSuchElementException("Could not find an element");
    }
View Full Code Here

    public void should_display(String selectValue) {
    }
   
    @Step
    public void should_have_selected_value(String selectValue) {
        throw new NoSuchElementException("This is not the element you're looking for");
    }
View Full Code Here

    @Test
    public void the_acceptance_test_case_is_in_error_if_a_test_step_has_an_error() {

        testOutcome.recordStep(forASuccessfulTestStepCalled("Step 1"));
        testOutcome.recordStep(forABrokenTestStepCalled("Step 2", new StepFailureException("Oh bother",new NoSuchElementException("Can't find element"))));
        testOutcome.recordStep(forASuccessfulTestStepCalled("Step 4"));

        assertThat(testOutcome.getResult(), is(ERROR));
    }
View Full Code Here

       
    }

    @Step
    public void failsToFindElement() {
        throw new NoSuchElementException("Could not find an element");
    }
View Full Code Here

       
    }

    @Step
    public void stepThatFailsWithWebdriverException() {
        throw new NoSuchElementException("No such element");
    }
View Full Code Here

  public WebElement findElementImmediately() {
    SmartAnnotations annotations = new SmartAnnotations(field);
    By by = annotations.buildBy();
    WebElement element = driver.findElement(by);
    if (element == null) {
      throw new NoSuchElementException("No such element found for criteria " + by.toString());
    }
    return element;
  }
View Full Code Here

  public WebElement ajaxFindElement() {
    SlowLoadingElement loadingElement = new SlowLoadingElement(clock, timeOutInSeconds);
    try {
      return loadingElement.get().getElement();
    } catch (NoSuchElementError e) {
      throw new NoSuchElementException(
          String.format("Timed out after %d seconds. %s", timeOutInSeconds, e.getMessage()),
          e.getCause());
    }
  }
View Full Code Here

        }
    SlowLoadingElementList list = new SlowLoadingElementList(clock, timeOutInSeconds);
    try {
      return list.get().getElements();
    } catch (NoSuchElementError e) {
      throw new NoSuchElementException(
          String.format("Timed out after %d seconds. %s", timeOutInSeconds, e.getMessage()),
          e.getCause());
    }
  }
View Full Code Here

TOP

Related Classes of org.openqa.selenium.NoSuchElementException

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.