When running a test on BrowserStack Automate, I run into the ‘blocked a script from accessing cross-origin assets/frames/resources’ error. What should I do?

This error is related to the same-origin policy. It’s a security measure implemented by most modern browsers. Scripts running on a web page are blocked from accessing resources running on another web page, unless both pages have the same origin. In other words, both pages must match the same parent domain.

To handle this scenario, you need to create a custom fix at your end. Refer to Cross-domain iFrame Automation.

Note: To deactivate cross-origin resource sharing (CORS) restrictions on Automate macOS computers, use BrowserStack’s disableCorsRestrictions capability.

Other Resources

Still can’t find what you are looking for?

We are always happy to help with any questions

Support resources Contact Us

Provide your business email to continue