rpaframework icon indicating copy to clipboard operation
rpaframework copied to clipboard

Add keyword to install browser extensions to Selenium

Open mikahanninen opened this issue 3 years ago • 1 comments

Related to this example Robot

Python example of the how Firefox extension can be installed

    @keyword
    def firefox_install_addon(self, path, temporary=None):
        # 'path' is absolute path to the addon that will be installed
        payload = {"path": path}
        if temporary:
            payload["temporary"] = temporary
        # The function returns an identifier of the installed addon.
        # This identifier can later be used to uninstall installed addon.
        return self.driver.execute("INSTALL_ADDON", payload)

mikahanninen avatar Dec 16 '21 09:12 mikahanninen

Sounds good, I'm also thinking on enabling support for installing extensions given all combinations between: (Playwright, Selenium) X (Chrome, Firefox) so people can install them without extending the libraries or doing any hacks.

ToDo

  • [ ] Use Extension keyword (open to other naming) for the following:
    • [ ] Installing the addon with Selenium + Firefox (on Chrome you add it as an option)
    • [ ] Opening the browser with Playwright + Chrome/Firefox (adding as CLI param which extension you want to load)
  • [ ] Portal example showcasing how this works with a real extension in both Selenium & Playwright with Chrome/Firefox. (bot will be non-headless first and headless too if supported)
  • [ ] Improve Portal LastPass bot for Selenium case as well and check if Chrome still has trouble loading extensions in headless mode.
  • [ ] Spread the word in the community Slacks/forums related to this problem.

cmin764 avatar Aug 03 '22 11:08 cmin764