Take the 2-minute tour ×
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It's 100% free, no registration required.

I'm using python 2.7.1 and selenium 2.20.0.
I have a seperate firefox profile called "selenium" which I want to use when running the webdriver.
I managed to do it by specifying the complete path to the profile as shown below, but that's not very portable code.

profile = FirefoxProfile("/Users/username/Library/Application Support/Firefox/Profiles/jtokyple.selenium")
self.driver = webdriver.Firefox(profile)

Is there any better way to specify the profile?

share|improve this question
add comment

2 Answers 2

Using WebDriver you can add any addons and change any configurations you want from the programming code. It's not required to create separate firefox profile

share|improve this answer
    
Great, so suppose I want to have a setting where files get downloaded automatically without a popup to a particular directory. I can set it manually in Firefox and it works for my user, but not when Selenium is driving it. How can I change this in code? –  Leonid Nov 20 '12 at 0:12
add comment

If you want it to be portable, you need to have the firefox profile included in your build and copied to the working directory. You should be able to reference it from there easily. This will work even if you copy all of your tests to a different machine and execute them there.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.