Appium ignores iframe context when getting page source (iOS)
See original GitHub issueWhen the driver is switched to the context of an iframe and you attempt to get the page source, you’ll get the source for the parent page instead of the iframe. For example assume you have the following webpages:
index.html
<html>
<head>
<title>PARENT PAGE</title>
</head>
<body>
<div>PARENT PAGE DIV</div>
<iframe src="frame.html" id="myFrame"></iframe>
</body>
</html>
frame.html
<html>
<head>
<title>IFRAME PAGE</title>
</head>
<body>
<div id='iframeDiv'>IFRAME PAGE DIV</div>
</body>
</html>
And you execute the following driver commands (showing python here but I’ve seen this via java bindings as well):
driver = webdriver.Remote( command_executor='http://127.0.0.1:4444/wd/hub', desired_capabilities={'browserName': 'Safari', 'deviceName': 'iPhone 5s', 'platformVersion': '8.1', 'platformName': 'iOS'})
driver.get('http://localhost:8000/index.html')
driver.switch_to.frame(driver.find_element_by_tag_name("iframe"))
print driver.page_source
The page source printed there will be from index.html instead of frame.html
Issue Analytics
- State:
- Created 8 years ago
- Reactions:1
- Comments:24 (15 by maintainers)
Top Results From Across the Web
Unable to manipulate click in IFrame using Android WebDriver
It work fine on an iOS simulator, but on the Android it does nothing. The test continue to run, but not action is...
Read more >Use Selenium wait for page to load with Python [Tutorial]
Deep dive into this Python Selenium wait tutorial and find the answer to the need for usage of Selenium wait for the page...
Read more >AppiumLibrary - GitHub Pages
AppiumLibrary is a Mobile App testing library for Robot Framework. Locating or specifying elements. All keywords in AppiumLibrary that need ...
Read more >Cross platform testing example for Android and iOS using ...
In that case, yes there is. When you are using appium, you normally operate in the native context. But if your app contains...
Read more >WebDriver - CodeceptJS
checkOption. Selects a checkbox or radio button. Element is located by label or name or CSS or XPath. The second parameter is a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This should be fixed in the latest beta version of Appium (and will be in 1.7.2)
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.