views:

548

answers:

3

Hi,

I am using WebDriver tool (similar to selenium) in a java application for linux. I am using webdriver to autofill form an submit it. I am facing problem with htaccess sites i.e., I am not able to access ht access site through Web driver.

Can anyone help me out in this regard.

Thanks in advance, Sunil.

+1  A: 

From Selenium FAQ (which is down at the moment):

How do I use Selenium to login to sites that require HTTP basic authentication (where the browser makes a modal dialog asking for credentials)?

Use a username and password in the URL, as described in RFC 1738: Test Type
open http://myusername:[email protected]/blah/blah/blah

Note that on Internet Explorer this won't work, since Microsoft has disabled usernames/passwords in URLs in IE. However, you can add that functionality back in by modifying your registry, as described in the linked KB article. Set an "iexplore.exe" DWORD to 0 in HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_HTTP_USERNAME_PASSWORD_DISABLE.

If you don't want to modify the registry yourself, you can always just use Selenium Remote Control, which automatically sets that that registry key for you as of version 0.9.2.

Bozho
Thanks for your quick response. Will this work on mozilla on linux?
sunil
it should. try it.
Bozho
I tried on mozilla and its working fine. Thanks for the help.
sunil
A: 

There is an outstanding issue for WebDriver to support basic and digest HTTP authentication. If you want to be notified of changes I suggest voting for the issue at http://code.google.com/p/selenium/issues/detail?id=34

Dave Hunt
A: 

I tried it in Selenium IDE, but it keeps removing the "@"-character from the base URL.

Daniel Alvarez Arribas