Is there any reliable way to allow only Selenium to access the site?
When I use $this->open($url)
from the PHPUnit's SeleniumTestCase t开发者_StackOverflow社区his makes a regular request to the server. How can I force this method to send some additional headers?
You could add auth to your .htaccess for that site/subfolder and preprend the simple auth user@password to your url before each request.
Reading about simple auth with .htaccess and .htpasswd:
http://www.htaccesstools.com/htaccess-authentication/
If you want to add additional headers have a look at the selenium.addCustomRequestHeader([key],[value]); function.
I would allow access to the site only from the Selenium machine's IP, i.e. via .htaccess or web server config directives.
精彩评论