Method: MobyBehaviour::TestObject#state_object

Defined in:
lib/tdriver/base/test_object/behaviours/test_object.rb

#state_objectObject

description

Returns a StateObject containing the current state of this test object as XML. The state object is static and thus is not refreshed or synchronized etc.

returns

StateObject

description: State of this test object
example: -

exceptions

ArgumentError

description: If the xml source for the object cannot be read


431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
# File 'lib/tdriver/base/test_object/behaviours/test_object.rb', line 431

def state_object

  # == example
  # app_state = @sut.application( :name => "calculator" ).state #get the state object for the app
  # button_state = app_state.Button( :text => "Backspace" ) #get the state for test object button
  # button_text = button_state.attribute( "text" ) #get attribute text from the button state object

  MobyBase::StateObject.new( 

    :source_data => xml_data, 
    :parent => self,
    :test_object_adapter => @test_object_adapter

  )

end