Package net.sf.sahi.client

Examples of net.sf.sahi.client.ElementStub


    throw new RuntimeException( "Set impossible on " + descriptor );
  }

  @Override
  public void verify( ElementDescriptor descriptor, boolean expectedOutcome ) {
    ElementStub element = find( descriptor );
    assertEquals( expectedOutcome,
                  executeOperation( element.getText(), descriptor.getValue(), descriptor.getOperation() ) );
  }
View Full Code Here


    return StringUtils.equalsIgnoreCase( descriptor.getType(), TYPE );
  }

  @Override
  public ElementStub find( ElementDescriptor descriptor ) {
    return addParents( new ElementStub( CwbElementStub.RADIO, browser, descriptor.getSahiArguments() ),
                       descriptor );
  }
View Full Code Here

                       descriptor );
  }

  @Override
  public void set( ElementDescriptor descriptor ) {
    ElementStub element = find( descriptor );
    if ( StringUtils.equalsIgnoreCase( CHOOSE, descriptor.getValue() ) || StringUtils.startsWithIgnoreCase(
        CheckboxElementHandler.CHECKED, descriptor.getValue() ) ) {
      element.click();
    }
  }
View Full Code Here

    }
  }

  @Override
  public void verify( ElementDescriptor descriptor, boolean expectedOutcome ) {
    ElementStub element = find( descriptor );
    if ( StringUtils.equalsIgnoreCase( CHOSEN, descriptor.getValue() ) || StringUtils.startsWithIgnoreCase(
        CheckboxElementHandler.CHECKED, descriptor.getValue() ) ) {
      assertEquals( expectedOutcome, element.checked() );
    }
    else {
      assertNotEquals( expectedOutcome, element.checked() );
    }
  }
View Full Code Here

{
  @Autowired
  private SahiBrowser browser;

  public ElementStub find( Object[] arguments, ElementStub parent ) {
    ElementStub labelElement = parent != null ? browser.label( arguments ).in( parent ) : browser.label( arguments );

    if ( labelElement.exists() ) {
      String targetId = labelElement.getAttribute( "htmlFor" );

      if ( StringUtils.isNotBlank( targetId ) ) {
        return browser.byId( targetId );
      }
    }
View Full Code Here

        descriptor.getType(), ButtonElementHandler.TYPE );
  }

  @Override
  public ElementStub find( ElementDescriptor descriptor ) {
    return addParents( new ElementStub( descriptor.getType(), browser, descriptor.getSahiArguments() ),
                       descriptor );
  }
View Full Code Here

    throw new RuntimeException( "Set impossible on " + descriptor );
  }

  @Override
  public void verify( ElementDescriptor descriptor, boolean expectedOutcome ) {
    ElementStub element = find( descriptor );
    assertEquals( expectedOutcome,
                  executeOperation( element.getText(), descriptor.getValue(), descriptor.getOperation() ) );
  }
View Full Code Here

    return find( arguments, null );
  }

  public ElementStub find( Object[] arguments, ElementStub parent ) {
    for ( ElementStubLookup lookup : lookups ) {
      ElementStub element = lookup.find( arguments, parent );

      if ( element != null ) {
        return element;
      }
    }
View Full Code Here

    return isSelect( descriptor ) && !isMultipleSelect( descriptor );
  }

  @Override
  public ElementStub find( ElementDescriptor descriptor ) {
    return addParents( new ElementStub( CwbElementStub.SELECT, browser, descriptor.getSahiArguments() ),
                       descriptor );
  }
View Full Code Here

                       descriptor );
  }

  @Override
  public void set( ElementDescriptor descriptor ) {
    ElementStub element = find( descriptor );
    element.choose( descriptor.getValue() );
  }
View Full Code Here

TOP

Related Classes of net.sf.sahi.client.ElementStub

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.