Skip to content

Basic Authentication in Firefox from within robotframework  #164

Closed

Description

@DJoeri

I have a problem to log in on Firefox 18 with basic authentication.
I googled the below workaround, but i do not understand how i need to integrate this solution in robotframework.
It seems i need to use the Selenium webdriver for this, but how do i call this upfront, and what about the "Library Selenium2Library" in my testcase-file .
Can i call this code upfront, and use this selenium-object as a variable in my testcase file?

[workaround]
Firefox 17 'username:password' (RFC1738) processing is disallowed by default in Firefox (it had worked earlier). However, I've found that it can be re-enabled by:

FirefoxProfile profile = new FirefoxProfile();
profile.setPreference("network.negotiate-auth.trusteduris", hostname);
driver = new FirefoxDriver(profile);
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
selenium = new WebDriverBackedSelenium(driver, "http:// + username + ":"
+ password + "@"
+ hostname + ":" + port + baseUrl);

Works on Selenium 2.28.0, Firefox 17; used for DigestAuth login.

Activity

  1. DJoeri commented on Jan 25, 2013

    @DJoeri
    Author

    i found a solution on the net which is more elegant:

    1. for robotframework-Selenium2Library (which i'm not succeeding to install for the moment), you can set a custom profile yourself with the option ff_profile_dir of the "start Selenium Server" keyword.
      This option is not supported on SeleniumLibrary.
      Since i'm using ant java task to start robotframework , the above method is not usable anyhow (it seems my classpath is not correct, and therefore roboframework cannot find the selenium-server.jar). That is the reason why i start Selenium server (standalone) upfront before my robotframework testcases , and in there you can define the optional parameter "firefoxProfileTemplate":
    2. generate a new firefox profile by starting the ff profile manager (dos prompt: ff.exe -p)
    3. start ff with this profile.
    4. install the add-on Auto-auth, (which allows you to log on automatically on sites with basic auth when you have stored the credentials in the password manager of ff; without this add-on, for every new session you will get prompted for the credentials, even if you stored them in the password manager.)
    5. goto your website, fill in the credentials, and save them in the password manager.
    6. use this profile to run your robotframework tests: start the selenium server standalone with the option -firefoxProfileTemplate 'C:\Program Files (x86)\Mozilla Firefox...\path_to_this_new_profile'
  2. just-be-dev commented on Jul 17, 2015

    @just-be-dev
    Contributor

    Is this still an issue?

    If so, would you please open a new task?

    Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions