20 January, 2015

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.

1 comment:

  1. Sir,
    Does the same origin policy violated in case of cross browser testing?

    ReplyDelete