lib/rautomation/adapter/ms_uia/text_field.rb in rautomation-0.9.0 vs lib/rautomation/adapter/ms_uia/text_field.rb in rautomation-0.9.1

- old
+ new

@@ -10,19 +10,11 @@ #todo - replace with UIA version # @see RAutomation::TextField#set def set(text) raise "Cannot set value on a disabled text field" if disabled? - - wait_until do - hwnd = Functions.control_hwnd(@window.hwnd, @locators) - @window.activate - @window.active? && - Functions.set_control_focus(hwnd) && - Functions.set_control_text(hwnd, text) && - value == text - end + UiaDll::set_control_value(search_information, text) end # @see RAutomation::TextField#clear def clear raise "Cannot set value on a disabled text field" if disabled? @@ -30,16 +22,10 @@ end #todo - replace with UIA version # @see RAutomation::TextField#value def value - Functions.control_value(hwnd) - end - - #todo - replace with UIA version - # @see RAutomation::TextField#hwnd - def hwnd - Functions.control_hwnd(@window.hwnd, @locators) + UiaDll::get_control_value(search_information) end def exist? super && matches_type?(Constants::UIA_EDIT_CONTROL_TYPE, Constants::UIA_DOCUMENT_CONTROL_TYPE) end