What is ‘Same Origin Policy’ in Selenium?

Lets Say, for a website ‘www.google.com’ the HTML code uses a JavaScript Program called ‘xyz.js’.
Because of same origin policy the ‘xyz.js’ file can access pages only from Google site. i.e Same domain and not from the other domain site like Yahoo,ebay,etc.
‘Same Origin Policy’ does not allow JavaScript code from accessing elements from other domain where it was Launched.
A JavaScript program can only access pages on the same domain where it belongs it cannot access pages from different domains.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s