web analytics
Google + RSS Feed

What is Same origin policy and how it can be handled?

0

January 12, 2017 by admin

What is Same origin policy and how it can be handled?

The problem of same origin policy disallows to access the DOM of a document from an origin that is different from the origin we are trying to access the document.

Origin is a sequential combination of scheme, host and port of the URL. For example, for a URL http:// http://www.seleniumwebdriver.org/resources/, the origin is a combination of http, seleniumwebdriver.org, 80 correspondingly.

Thus the Selenium Core (JavaScript Program) cannot access the elements from an origin that is different from where it was launched. For Example, if I have launched the JavaScript Program from “http://www.seleniumwebdriver.org”, then I would be able to access the pages within the same domain such as “http://www.seleniumwebdriver.org/resources” or “http://www.seleniumwebdriver.org/istqb-free-updates/”. The other domains like google.com, seleniumhq.org would no more be accessible.

So, In order to handle same origin policy, Selenium Remote Control was introduced.

 

 


0 comments »

Leave a Reply

Your email address will not be published. Required fields are marked *


seven − 4 =

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Recent Posts