I am writing a test for a hybrid app which contains an iframe and I’m trying to click a button inside the iframe.
It worth mentioning that the data inside the iframe is in another origin. Nevertheless, I managed to switch to the iframe and I can see the content of it.
It returns the same content before and after switching to frame, so desired element is not found by Android Driver although actually we see it.
I have not enough time to reproduce it on Android SDK emulator. @shlomitc, have you tried? Is it reproduced?
I think it is an issue of the working with chromedriver (it is actually used). Tomorrow I will report this issue. Or… @shlomitc, could you report this issue here
As written in my last post, use contexts() to get the contexts list, then context(<the context name>) to switch to the wanted context (from native to Webview in my case).
Then, switch to the wanted iframe using frame(<frame id>).
Now you’re pointing to the wanted iframe your webview.
now you can use tap() on the last element:
.elementByXPath('//li[div/span[contains(text(),"Data I want")]]').tap()
You can use any other strategy to make it work such as elementById(), elementByClassName() etc…
getting below exception
Exception in thread “main” org.openqa.selenium.WebDriverException: ‘undefined’ is not an object (evaluating ‘b.querySelector’) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 62 milliseconds
Build info: version: ‘2.43.1’, revision: ‘5163bce’, time: ‘2014-09-10 16:27:33’
System info: host: ‘N/A’, ip: ‘N/A’, os.name: ‘Mac OS X’, os.arch: ‘x86_64’, os.version: ‘10.9.5’, java.version: ‘1.7.0_71’
Session ID: 28cc78cb-c9b9-4097-854d-cf6a28f0dfb5
Driver info: io.appium.java_client.AppiumDriver
But it is supposed to be an issue of chromedriver. Does SafariDriver works with WEBVIEV on iOS? It is possible that SafariDriver cann’t work with frames in WEBVIEV
yes, it’s IOS with Safari browser. I had this issue when I try to execute the selenium script using Appium in Mobile Safari browser. Where as the same script, I am able execute in Mac Desktop with Safari Browser and Windows desktop with IE, Chrome and Firefox. I think it’s an issue with Appium.