开发者

How to test win Selenium 2 if site is active at all then test if basic http authentication is present or failed?

开发者 https://www.devze.com 2023-03-24 05:22 出处:网络
I first need to know if the site is present at all, such as when the connection is refused rather than a browser error or something, then test basic http authentication is present or failed, ie to kno

I first need to know if the site is present at all, such as when the connection is refused rather than a browser error or something, then test basic http authentication is present or failed, ie to know that the failure is due to the presence of http authentication.

I first want to find out if a failure is due to http authentication, the开发者_运维百科n if it is try with a password and find out if that also fails or not.


As you can see here: http://code.google.com/p/selenium/wiki/RoadMap

Support HTTP Basic and Digest Authentication: Not Started

So just wait for it.

If a site is present you can check by testing if a specific element you expect to appear is present or not. Therefore you need a timeout (maybe 30 sec.) after which you can mark the test as a fail if the element didn't appear in that time.


Just to add - only way to go to HTTP Basic authentification site is via loading URL like:

http://username:password@the-site.com

I suggest having test which loads page via this URL - then you know that HTTP basic auth is there

Its kinda workaround solution, but there is nothing better yet

0

精彩评论

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

关注公众号