How Selnium WebDriver overcomes Same Origin Policy -
how selenium webdriver overcome same origin policy?
same origin policy problem in selenium rc
first of “same origin policy” introduced security reason, , ensures content of site never accessible script site. per policy, code loaded within browser can operate within website’s domain.
--------------------------------------------------------------------------------- ----------------------------------------------
what did???
same origin policy prohibits javascript code accessing elements domain different launched. example, html code in www.google.com uses javascript program "testscript.js". same origin policy allow testscript.js access pages within google.com such google.com/mail, google.com/login, or google.com/signup. however, cannot access pages different sites such yahoo.com/search or fbk.com because belong different domains.
this reason why prior selenium rc, testers needed install local copies of both selenium core (a javascript program) , web server containing web application being tested belong same domain.
------------------------------------------------------------------------------------------------------------------------------------
how avoided???
avoid “same origin policy” proxy injection method used, in proxy injection mode selenium server acts client configured http proxy , sits between browser , application under test , masks aut under fictional url
selenium uses java script drives tests on browser; selenium injects own js response returned aut. there java script security restriction (same origin policy) lets modify html of page using js if js originates same domain html. security restriction of utmost important spoils working of selenium. selenium server comes play important role.
Comments
Post a Comment