Need a way to specify a profile

Bug #1262218 reported by Martin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
selenium-simple-test
New
Undecided
Unassigned

Bug Description

I have installed both iceweasel and xul-ext-noscript on my computer. Therefore by default Javascript is switched off. My tests, however, need Javascript switched on. Also, I need other changes to the default Iceweasel configuration for some tests, e.g. accepted languages. A solution to this problem could be to specify a profile for testing. I hacked SST this way to achieve this:

class Firefox(selenium.webdriver.Firefox):
    def __init__(self):
        d = os.path.dirname(os.path.expanduser("~") + "/.mozilla/firefox/selenium/")
        if not os.path.exists(d):
            os.makedirs(d)
        fp = webdriver.FirefoxProfile(d)
        fp.native_events_enabled = False
        fp.set_preference("browser.download.folderList",2)
        fp.set_preference("extensions.checkCompatibility.3.6",False)
        fp.set_preference("services.sync.engine.addons",False)
        fp.set_preference("extensions.getAddons.cache.enabled",False)
        fp.set_preference("browser.download.manager.showWhenStarting",False)
        fp.set_preference("browser.download.dir", download_dir)
        fp.set_preference("browser.helperApps.neverAsk.saveToDisk", "application/octet-stream")
        fp.set_preference("browser.helperApps.neverAsk.saveToDisk", "text/csv")
        super(Firefox, self).__init__(firefox_profile=fp)
        self.implicitly_wait(5) # seconds
        self.set_window_size(1024,1000)

It would be nice to have a clean, non-hacky way to achieve this.

See question https://answers.launchpad.net/selenium-simple-test/+question/197442

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.