Most if not all examples I read here are about an native or hybrid app and how to switch between context to be able to interact with the elements.
I’m using Chrome and a website.
So my first question is, does this automatically start in the webview context?
Q2; Do I need to switch to the webview to be able to interact?
Q3: Is there a page that explains this scenario (ruby + appium + android chrome webpage + context)?
I was not able to find what I needed so far.
What I did:
require 'appium_lib'
capabilities = {
deviceName: 'Nexus5',
browserName: 'chrome',
platformName: :android,
newCommandTimeout: 15000,
}
browser = Appium::Driver.new(caps: capabilities).start_driver
browser.get("https://www.google.nl")
So far so good, chrome starts and I can navigate to a url.
I can even find elements by ID:
irb(main):045:0> e = browser.find_element(:id, 'lst-ib')
=> #<Selenium::WebDriver::Element:0x..f926f926a id="0.9853208960371109-1">
However I cannot perform a tap/press on this element (or on random x,y coordinates) - see https://discuss.appium.io/t/ruby-appium-touchaction-perform-returns-error-method-has-not-yet-been-implemented/18308
Which leaves me thinking I might need to figure out what context I’m trying to perform these actions on.
However, This failed:
irb(main):050:0> browser.contexts = available_contexts
NameError: undefined local variable or method `available_contexts' for main:Object
from (irb):50
from C:/Ruby23/bin/irb.cmd:19:in `<main>'
irb(main):051:0> contexts = available_contexts
NameError: undefined local variable or method `available_contexts' for main:Object
from (irb):51
from C:/Ruby23/bin/irb.cmd:19:in `<main>'
So what Am I doing wrong here?