jarmo / RAutomation

RAutomation
MIT License
100 stars 33 forks source link

MsUia: ControlType.Document Support #52

Closed leviwilson closed 11 years ago

leviwilson commented 11 years ago

I was able to reproduce it in the test (by calling something that loads .NET into the picture). Anyway, let me know what you think.

jarmo commented 11 years ago

Everything is green for MsUia, but i'm seeing some failures for other adapters.

Win32:

  1) Win32::Mouse#press/#release
     Failure/Error: text_field.set("start string")
     RuntimeError:
       Cannot set value on a disabled text field
     # ./lib/rautomation/adapter/win_32/text_field.rb:47:in `assert_enabled'
     # ./lib/rautomation/adapter/win_32/text_field.rb:13:in `set'
     # ./lib/rautomation/text_field.rb:16:in `set'
     # ./spec/adapter/win_32/mouse_spec.rb:32:in `block (2 levels) in <top (required)>'

  2) Win32::TextField enabled/disabled
     Failure/Error: RAutomation::Window.new(:title => "MainFormWindow").text_field(:index => 1).should be_enabled
       expected enabled? to return true, got false
     # ./spec/adapter/win_32/text_field_spec.rb:6:in `block (2 levels) in <top (required)>'

  3) Win32::TextField cannot set a value to a disabled text field
     Failure/Error: lambda { RAutomation::Window.new(:title => "MainFormWindow").text_field.set "abc" }.should raise_error
       expected Exception but nothing was raised
     # ./spec/adapter/win_32/text_field_spec.rb:11:in `block (2 levels) in <top (required)>'

  4) Win32::TextField#send_keys
     Failure/Error: text_field.send_keys "abc"
     RuntimeError:
       Cannot set value on a disabled text field
     # ./lib/rautomation/adapter/win_32/text_field.rb:47:in `assert_enabled'
     # ./lib/rautomation/adapter/win_32/text_field.rb:34:in `send_keys'
     # ./lib/rautomation/text_field.rb:49:in `method_missing'
     # ./spec/adapter/win_32/text_field_spec.rb:17:in `block (2 levels) in <top (required)>'

  5) Win32::Window#send_keys send arbitrary characters and control keys
     Failure/Error: text_field.focus
     RuntimeError:
       Cannot set value on a disabled text field
     # ./lib/rautomation/adapter/win_32/text_field.rb:47:in `assert_enabled'
     # ./lib/rautomation/adapter/win_32/control.rb:65:in `focus'
     # ./lib/rautomation/text_field.rb:49:in `method_missing'
     # ./spec/adapter/win_32/window_spec.rb:19:in `block (3 levels) in <top (required)>'

Autoit:

 1) AutoIt::Mouse#press/#release
     Failure/Error: text_field.set("start string")
     RAutomation::WaitHelper::TimeoutError:
       timed out after 15 seconds
     # ./lib/rautomation/wait_helper.rb:20:in `wait_until'
     # ./lib/rautomation/adapter/autoit/text_field.rb:39:in `set'
     # ./lib/rautomation/text_field.rb:16:in `set'
     # ./spec/adapter/autoit/mouse_spec.rb:32:in `block (2 levels) in <top (required)>'
leviwilson commented 11 years ago

Ahh, yes. I bet it is using :index => 1 to find the editable text field at the top left. It should be :index => 2 now. Sorry about that. Would you like me to fix that or are you going to get it? I'm about to drive 3 hours back to Indiana ;-)

jarmo commented 11 years ago

No problems, i will do that myself. I suspected something similar myself. Have a safe trip :)