3

We are automating website using Appium script using iPhone Safari browser . We try to navigate to the frame to identify the element which is existing on the frame . but we are not able to navigate it getting below exception. could you please guide us how we can resolve it

org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Blocked a frame with origin "https://www.sample.com" from accessing a cross-origin frame. Protocols, domains, and ports must match.

Sai
  • 389
  • 2
  • 15
  • Does this answer your question? [SecurityError: Blocked a frame with origin from accessing a cross-origin frame](https://stackoverflow.com/questions/25098021/securityerror-blocked-a-frame-with-origin-from-accessing-a-cross-origin-frame) – Vault23 Dec 05 '19 at 07:31
  • Hi Valut, Thank you for the answer . I am using appium tool with java. that answer is for HTML – Sai Dec 05 '19 at 08:12
  • so what? **You can't access an – Vault23 Dec 05 '19 at 08:14
  • 1
    Chrome browser is allowing to access iframe if it is different domain. but Safari is not allowing it – Sai Dec 05 '19 at 09:00
  • 1
    i guess you answered your question – Vault23 Dec 05 '19 at 09:17

1 Answers1

0

We ran into a similar problem: the web site is on domain A.com, and the iframe is on B.com. When running on other platforms such as Chrome, we were able to access controls within the iframe. With iOS devices, such as iPads or iPhones, we got the error message.

For our application, we found the iframe element, retrieved it "src" URL, then navigated the browser to that URL. Now the former iframe was the main document and we could easily access its controls.

It may not be elegant, but it got the job done in a browser-independent fashion.

Chris Pousset
  • 281
  • 1
  • 3
  • 8