0

Suppose we are on the site http://site1.tld, whose HTML page index.html includes images from another site say http://site2.tld. This other site requires basic authentication to access, and we do have those details.

We are using Selenium RC and starting a Firefox 15.0.1 browser. We are writing our tests on Java 1.7.

We can use Selenium to navigate to the protected page using the username:password@site2.tld URL and hence allow for access.

My question is: is there a way to let the RC use the credentials just whenever it needs to load a resource from the protected site?

Simply put, can it "see" URL's like http:// site2.tld/image.png as if they are http:// username:password@site2.tld?

@rrufai: Your edit does not make my question clearer, therefore I am reverting it in part. However, since you did misinterpret it, I believe a clarification is indeed necessary – I would like Selenium RC to actually read the files on site2.tld as if their location was http:// username:password@site2.tld.

  • I don't thinkt that that is possible. Selenium/Webdriver simulates user interaction. And I don't think you can do that manually, can you? – Tarken Sep 18 '12 at 07:22
  • Thank you for the reply. You are probably right -- although WD does allow for some actions that a user can't do manually. The solution I used is to load site2.tld before the test. However, I believe another walk-through is sending custom headers but have had no time to look into it. – Ivaylo Bozhurin Sep 26 '12 at 06:16

0 Answers0