Package com.crawljax.core.state

Examples of com.crawljax.core.state.Identification


    String newXPath = new ElementResolver(eventable, browser).resolve();
    if (newXPath != null && !xpath.equals(newXPath)) {
      LOG.debug("XPath changed from {} to {} relatedFrame: {}", xpath, newXPath,
              eventable.getRelatedFrame());
      eventToFire =
              new Eventable(new Identification(Identification.How.xpath, newXPath),
                      eventType);
    }
    return eventToFire;
  }
View Full Code Here


    when(index.getName()).thenReturn("Index");
    when(target.getId()).thenReturn(2);
    when(target.getName()).thenReturn("State 2");

    when(eventToTransferToTarget.getIdentification()).thenReturn(
            new Identification(How.name, "//DIV[@id='click]"));
    when(eventToTransferToTarget.getRelatedFrame()).thenReturn("");
    when(eventToTransferToTarget.getSourceStateVertex()).thenReturn(index);
    when(eventToTransferToTarget.getTargetStateVertex()).thenReturn(target);
    when(eventToTransferToTarget.getRelatedFormInputs()).thenReturn(
            new CopyOnWriteArrayList<FormInput>());
View Full Code Here

   * @throws CrawljaxException
   *             when the event can not be fired.
   */
  @Test(expected = BrowserConnectionException.class)
  public void testFireEvent() throws Exception {
    browser.fireEventAndWait(new Eventable(new Identification(How.xpath, "/HTML"),
            EventType.click));
  }
View Full Code Here

   * {@link com.crawljax.browser.EmbeddedBrowser#input(com.crawljax.core.state.Identification, java.lang.String)}
   * .
   */
  @Test(expected = BrowserConnectionException.class)
  public void testInput() throws CrawljaxException {
    browser.input(new Identification(How.xpath, "/HTML"), "some");
  }
View Full Code Here

   * {@link com.crawljax.browser.EmbeddedBrowser#isVisible(com.crawljax.core.state.Identification)}
   * .
   */
  @Test(expected = BrowserConnectionException.class)
  public void testIsVisible() {
    browser.isVisible(new Identification(How.xpath, "/HTML"));
  }
View Full Code Here

   * {@link com.crawljax.browser.EmbeddedBrowser#getInputWithRandomValue(com.crawljax.forms.FormInput)}
   * .
   */
  @Test(expected = BrowserConnectionException.class)
  public void testGetInputWithRandomValue() {
    browser.getInputWithRandomValue(new FormInput("text", new Identification(How.xpath,
            "/HTML"), "abc"));
  }
View Full Code Here

   * {@link com.crawljax.browser.EmbeddedBrowser#elementExists(com.crawljax.core.state.Identification)}
   * .
   */
  @Test(expected = BrowserConnectionException.class)
  public void testElementExists() {
    browser.elementExists(new Identification(How.xpath, "/HTML"));
  }
View Full Code Here

   * {@link com.crawljax.browser.EmbeddedBrowser#getWebElement(com.crawljax.core.state.Identification)}
   * .
   */
  @Test(expected = BrowserConnectionException.class)
  public void testGetWebElement() {
    browser.getWebElement(new Identification(How.xpath, "/HTML"));
  }
View Full Code Here

   *             when the event can not be fired.
   */
  @Test
  public final void testFireEvent() throws Exception {
    browser.goToUrl(new URL(SERVER.getSiteUrl() + "simple.html"));
    browser.fireEventAndWait(new Eventable(new Identification(How.xpath, "//H1"),
            EventType.click));
  }
View Full Code Here

   *             when the input can not be found
   */
  @Test
  public final void testInput() throws CrawljaxException {
    assertFalse("Wrong Xpath so false because of error",
            browser.input(new Identification(How.xpath, "/RUBISH"), "some"));
  }
View Full Code Here

TOP

Related Classes of com.crawljax.core.state.Identification

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.