Package net.sf.sahi.client

Examples of net.sf.sahi.client.ElementStub


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

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


                       descriptor );
  }

  @Override
  public void set( ElementDescriptor descriptor ) {
    ElementStub element = find( descriptor );

    if ( !StringUtils.equalsIgnoreCase( TYPE, element.getAttribute( "type" ) ) ) {
      throw new RuntimeException( "Element is not a checkbox: " + descriptor );
    }

    if ( StringUtils.startsWithIgnoreCase( descriptor.getValue(), CHECKED ) ) {
      element.check();
    }
    else {
      element.uncheck();
    }
  }
View Full Code Here

    }
  }

  @Override
  public void verify( ElementDescriptor descriptor, boolean expectedOutcome ) {
    ElementStub element = find( descriptor );

    if ( StringUtils.startsWithIgnoreCase( descriptor.getValue(), CHECKED ) ) {
      assertEquals( expectedOutcome, element.checked() );
    }
    else {
      assertNotEquals( expectedOutcome, element.checked() );
    }
  }
View Full Code Here

    LOG.info( "Default element highlighting is {}", shouldHighlight == Boolean.TRUE ? "ON" : "OFF" );
  }

  public ElementStub find( ElementDescriptor descriptor ) {
    ElementStub found;

    for ( ElementHandler handler : getHandlersForDescriptor( descriptor ) ) {
      found = handler.find( descriptor );

      if ( found != null ) {
View Full Code Here

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

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

    element.choose( descriptor.getValue(), true );
  }

  @Override
  public void verify( ElementDescriptor descriptor, boolean expectedOutcome ) {
    ElementStub element = find( descriptor );
    boolean equals = matcher.equals( element.getValue(), descriptor.getValue() );
    if ( !equals ) {
      for ( String selectedValue : StringUtils.split( element.getSelectedText(), "," ) ) {
        equals |= matcher.equals( selectedValue, descriptor.getValue() );
      }
    }
    assertEquals( expectedOutcome, equals );
  }
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.