Method: Appium::Core::Base::Bridge#action

Defined in:
lib/appium_lib_core/common/base/bridge.rb

#action(_deprecated_async = nil, async: false, devices: nil) ⇒ Object

Perform ‘touch’ actions for W3C module. Generate touch pointer action here and users can use this via driver.action

The pointer type is ‘touch’ by default in the Appium Ruby client.

Examples:


element = @driver.find_element(:id, "some id")
@driver.action.click(element).perform # The 'click' is a part of 'PointerActions'


208
209
210
211
212
213
214
215
216
217
# File 'lib/appium_lib_core/common/base/bridge.rb', line 208

def action(_deprecated_async = nil, async: false, devices: nil)
  # steep:ignore:start
  ::Selenium::WebDriver::ActionBuilder.new(
    self,
    devices: devices || [::Selenium::WebDriver::Interactions.pointer(:touch, name: 'touch')],
    async: async,
    duration: 50 # milliseconds
  )
  # steep:ignore:end
end