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
精彩评论