Module: Appium::Core::Ios::Uiautomation

Defined in:
lib/appium_lib_core/ios/uiautomation/patch.rb,
lib/appium_lib_core/ios/uiautomation/bridge.rb,
lib/appium_lib_core/ios/uiautomation/device.rb

Defined Under Namespace

Modules: Bridge, Device

Class Method Summary collapse

Class Method Details

.patch_webdriver_elementObject

class_eval inside a method because class Selenium::WebDriver::Element will trigger as soon as the file is required. in contrast a method will trigger only when invoked.



23
24
25
26
27
28
29
30
# File 'lib/appium_lib_core/ios/uiautomation/patch.rb', line 23

def self.patch_webdriver_element
  ::Appium::Core::Element.class_eval do
    # Cross platform way of entering text into a textfield
    def type(text, driver)
      driver.execute_script %(au.getElement('#{ref}').setValue('#{text}');)
    end # def type
  end # Selenium::WebDriver::Element.class_eval
end