diff --git a/docs/en/advanced-concepts/cross-domain-iframes.md b/docs/en/advanced-concepts/cross-domain-iframes.md new file mode 100644 index 000000000..094e4be53 --- /dev/null +++ b/docs/en/advanced-concepts/cross-domain-iframes.md @@ -0,0 +1,35 @@ +## Cross-domain iFrame Automation + +[Same-origin policy](https://en.wikipedia.org/wiki/Same-origin_policy) prevents Appium from automating iFrames that have a different domain to the parent. + +### Subdomain workaround +If the parent and the iFrame share the same domain (e.g. `site.com` and `shop.site.com`), you can +set `document.domain` on both the parent and each iFrame to a common domain. This solves the same-origin policy issue and allows automation. For example: + +Parent: +``` + +
+ + + + + + +``` + +Child iFrame: +``` + + + + + +This is an iFrame!
+ + +```