Overcoming the limitations of Selenium Core

While working with Selenium Core I encountered a limitation as I tried to do a payment with PayPal: it is not possible to visit another domain from within your tests. The reason is the “Same Origin Policy” which applies to Selenium Core according to “Which Selenium Tool Should I Use?”:

Selenium Core needs to be installed on the same website as the Application Under Test (AUT), because of the Same Origin Policy, a security policy which prevents cross-site scripting. That means that you can’t just sit down and write a Selenium Core test that runs on google.com; to do that, you’d need to install Selenium Core on google.com. If you can’t/won’t install Selenium Core into your AUT, making it publicly visible on the same server as the AUT, then Selenium Core may not be right for you.

On “Which Selenium Tool Should I Use?” we find an alternative, which allows us to visit another domain from within our tests: Selenium IDE, a plug-in for Firefox. The only thing that changes is the way the tests are called. Instead of calling

http://project1.localhost/selenium/TestRunner.html?
test=/pages/tests/testsuite-all

we have to call in Firefox

chrome://selenium-ide/content/selenium/TestRunner.html?
test=http://project1.localhost/pages/tests/testsuite-all

to run the tests.

You find more information about CakePHP and Selenium on https://cakebaker.wordpress.com/tag/selenium.

%d bloggers like this: