Class: RAutomation::Adapter::MsUia::TextField

Inherits:
Control
  • Object
show all
Includes:
Locators, WaitHelper
Defined in:
lib/rautomation/adapter/ms_uia/text_field.rb

Constant Summary collapse

DEFAULT_LOCATORS =

Default locators used for searching text fields.

{:class => /edit/i}

Instance Method Summary collapse

Methods inherited from Control

#assert_enabled, #bounding_rectangle, #cached_hwnd, #click, #collapse, #control_class, #control_name, #disabled?, #enabled?, #expand, #focus, #focused?, #get_current_control_type, #help_text, #hwnd, #initialize, #matches_type?, #new_pid, #search_information, #visible?

Constructor Details

This class inherits a constructor from RAutomation::Adapter::MsUia::Control

Instance Method Details

#clear

See Also:



19
20
21
22
# File 'lib/rautomation/adapter/ms_uia/text_field.rb', line 19

def clear
  raise "Cannot set value on a disabled text field" if disabled?
  set ""
end

#exist?Boolean Also known as: exists?

Returns:

  • (Boolean)


30
31
32
# File 'lib/rautomation/adapter/ms_uia/text_field.rb', line 30

def exist?
  super && matches_type?(Constants::UIA_EDIT_CONTROL_TYPE, Constants::UIA_DOCUMENT_CONTROL_TYPE)
end

#set(text)

todo - replace with UIA version

See Also:



13
14
15
16
# File 'lib/rautomation/adapter/ms_uia/text_field.rb', line 13

def set(text)
  raise "Cannot set value on a disabled text field" if disabled?
  UiaDll::set_text(search_information, text)
end

#value

todo - replace with UIA version

See Also:



26
27
28
# File 'lib/rautomation/adapter/ms_uia/text_field.rb', line 26

def value
  UiaDll::get_text(search_information)
end