So I'm a relatively new Appium user, so please excuse me if this question seems a little basic.
My company has a hybrid application which uses webiews in several places, and I am currently in the middle of writing test scripts for this application in Ruby using Appium. I've been stuck for a while, because I reach a page where I need to search for elements inside a webview and click on them. So far, I've managed to switch contexts to the webview using
set_context context_array.last
and I know that the context switch is successful, because I then output my current context to the terminal, and it correctly outputs that I'm in the webview. I then used Safari to inspect the elements in my webview, and saw the following HTML code:
I followed the xlink and found the following lines of code:
<symbol id="icon-eat" viewBox="0 0 58 58">
<title>icon-eat</title>
So in my Appium script, I've tried to locate the element using the following, which so far haven't worked.
1. wait { xpath('//symbol[@id="icon-eat"]') }
2. wait { id("icon-eat") }
Any advice on how to proceed? My capabilities are:
options = {
caps: {
platformName: 'iOS',
platformVersion: '10.3',
deviceName: 'iPhone 7',
app: APP_PATH,
automationName: "XCUITest",
browserName: "iOS",
startIWDP: true,
nativeWebTap: true
},
launchTimeout: 20000
}
An Appium log is attached. I've replaced the company name and other sensitive details for security purposes.
https://drive.google.com/file/d/0B6mwi0KrKYGQTGctek9wWm5ES28/view?usp=sharing