Sha256: fee4620dc74efafda2d9b50e239f7fc547715b3b2f7417857d2f0ccc396cb430
Contents?: true
Size: 1.34 KB
Versions: 4
Compression:
Stored size: 1.34 KB
Contents
module RAutomation module Adapter module WinFfi class TextField < Control include WaitHelper include Locators # Default locators used for searching text fields. DEFAULT_LOCATORS = {:class => /edit/i} # @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 end # @see RAutomation::TextField#clear def clear raise "Cannot set value on a disabled text field" if disabled? set "" end # @see RAutomation::TextField#value def value Functions.control_value(hwnd) end # @see RAutomation::TextField#hwnd def hwnd Functions.control_hwnd(@window.hwnd, @locators) end def exist? @locators[:id].nil? ? super : super && matches_type(Constants::UIA_EDIT_CONTROL_TYPE) end alias_method :exists?, :exist? end end end end
Version data entries
4 entries across 4 versions & 1 rubygems