Closed mitchellfx closed 8 years ago
Out of the box Label
controls do not support the ValuePattern
in UIA; their Name
property reflects the text of them. If you want to interact with the ValuePattern
try using #text_field
instead of #label
.
Closing this.
label.value from the following example returns the label name instead of the label value. The actual label value appears to be inaccessible.
irb(main):191:0> win = RAutomation::Window.new(:title => /FiREapps/, :adapter > => #<RAutomation::Window:0x2c8e390 @adapter=:ms_uia, @window=#<RAutomation::Adap ter::MsUia::Window:0x2c8e240 @container=#<RAutomation::Window:0x2c8e390 ...>, @l ocators={:index=>0, :title=>/FiREapps/}>> irb(main):192:0> frame = win.child(:class => 'Frame Notification Bar') => #<RAutomation::Window:0x2d6ed90 @adapter=:ms_uia, @window=#<RAutomation::Adap ter::MsUia::Window:0x2d6ec58 @container=#<RAutomation::Window:0x2d6ed90 ...>, @l ocators={:index=>0, :class=>"Frame Notification Bar", :hwnd=>1247622}, @hwnd=124 7622>> irb(main):193:0> label = frame.label(:value => "Notification bar Text") => #<RAutomation::Adapter::MsUia::Label:0x2e5c858 @window=#<RAutomation::Adapter ::MsUia::Window:0x2d6ec58 @container=#<RAutomation::Window:0x2d6ed90 @adapter=:m s_uia, @window=#<RAutomation::Adapter::MsUia::Window:0x2d6ec58 ...>>, @locators= {:index=>0, :class=>"Frame Notification Bar", :hwnd=>1247622}, @hwnd=1247622>, @ locators={:index=>0, :value=>"Notification bar Text"}> irb(main):194:0> label.exists? => true irb(main):195:0> label.value => "Notification bar Text"