开发者

Allow only Selenium access the page

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜