I am interested in using Selenium Nodes to install and interact with a Chrome Extension on a Chrome browser. Has anyone had any success with this before?
Based on my research, it seems possible to adjust the WebDriver script to include ‘Capabilities’ via Chrome ‘Options’, one of which is adding Chrome Extensions. It looks like it might be possible with palladian extension points, but I am unclear on how to do this.
I haven’t yet come across any KNIME specific solutions that can install & interact with Chrome Extensions using Selenium Nodes, but it seems there are other ways to do this in other platforms. I would be very grateful for some guidance, or possibly even an example workflow of how others have solved this issue(!).
Here are 4 basic examples for how I would like to use Selenium Nodes with a Chrome Extension. Example Chrome Extension here is Requestly.
- Open a Chrome browser instance where the “Requestly” Chrome Extension is installed on the browser
- Click on the Requestly browser extension button in the browser navigation to open the browser popup (see screenshot)
- Toggle the “On/Off” button in the browser extension popup (see screenshot)
- Click the “Open App” button in the browser extension popup (see screenshot)
Thank you kindly for reading, and for any help you might be able to offer!
interesting project – to my surprise, it seems indeed possible to interact with Chrome plugins using Selenium (I didn’t know that so far).
First, to get started, I would probably initially set up the local Chrome installation with the plugin already installed, and then start Chrome using this very profile (instead of a fresh one). While I generally do not recommend this in regards to reproducible workflows, it is fine for some initial proof of concept. Here’s an example workflow which uses a persistent profile:
Later, if you want to start a fresh browser and install an extension into it dynamically, this should be possible with the current “capabilities” configuration in the WebDriver Factory or Start WebDriver already. The crucial part is, that you’ll need to attach the extension file Base64-encoded (the Base64 Encoder might come in handy) and dynamically build a JSON snippet which includes this encoded string. (in fact, the example workflow above does something similar for setting the profile config)
For the actual interaction with the browser extension, the link you mentioned above should be helpful and you should be able to map this 1:1 to existing Selenium nodes (Navigate, Find Elements, Click, …)
Until here, all this should be possible without writing custom Java code and using the mentioned extension points. If you still want to explore these possibilities and you have any questions, don’t hesitate to get back to me (here or via email@example.com). The extension points were built for a specific customer project a while ago, but I’m not aware that someone actually made use of these, so I’d be eager about any feedback, etc.
PS: Out of curiosity and if you want to tell, why do you need to interact with this browser extension?
@kdd Curious to hear: How did it go?
@kdd Any feedback regarding the above?!?