Original error when I'm trying switch to iframe. Same code working fine with desktop browsers. This happens only with safari mobile browser. I'm on appium v1.20.2

SecurityError: Blocked a frame with origin "https://xxxxx.com" from accessing a cross-origin frame. Protocols, domains, and ports must match.

I found this post but that was 3 years ago,so is there any new solutions for this? https://developer.apple.com/forums/thread/80927

1 Answer 1


For the last 30 hours I was looking for a solution and couldn’t find a solution for safari iOS. As a workaround I just extract the iframe's src URL at the middle of my test and I navigate to the iframe's URL,

This is how it looks like, and now I was able to perform my test steps.

String ccURL = driver.findElement(frmPayment).getAttribute("src").toString();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.