Ruby Appium::TouchAction .perform returns error - Method has not yet been implemented

@KazuCocoa thnx, that was the mistake I made, wrong object.

irb(main):010:0> contexts = driver.available_contexts
=> ["NATIVE_APP", "CHROMIUM"]

So now it seems to work like this

appium = Appium::Driver.new(caps: capabilities)
driver = appium.start_driver

contexts = driver.available_contexts
=> ["NATIVE_APP", "CHROMIUM"]
current_context = driver.current_context
=> "CHROMIUM"

webview_context = contexts.detect { |e| e.start_with?('WEBVIEW') }
=> nil
nativeview_context = contexts.detect { |e| e.start_with?('NATIVE_APP') }
=> "NATIVE_APP"
chromiumview_context = contexts.detect { |e| e.start_with?('CHROMIUM') }
=> "CHROMIUM"
driver.get("https://www.google.nl")

driver.set_context nativeview_context

elm = driver.find_element(:id, 'lst-ib')

tap_action = Appium::TouchAction.new.tap(element: e, x:0.5, y:0.5)
tap_action.perform

Many thanks, this was what I was looking for.

1 Like