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

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

Defined Under Namespace

Modules: Bridge

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.



9
10
11
12
13
14
15
16
# File 'lib/appium_lib_core/ios/uiautomation/patch.rb', line 9

def self.patch_webdriver_element
  ::Selenium::WebDriver::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