Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add custom plugins to Selenium IDE (3.58) for chrome

I follow the instructions on this official guide but I am not able to successfully add my own commands.

I interested in adding some custom commands to make REST calls such as POST, PUT, DELETE and so on. I know there are other tools, like Katalon, that makes this very easy but I am asked to make it work on selenium IDE. I have tried with the sample code on the official guide but it does not work, it returns no errors but makes no changes either.

this is the example attemp I made:

chrome.runtime.sendMessage("mooikfkahbdckldjjndioackbalphokd", {
  uri: "/register",
  verb: "post",
  payload: {
    name: "Selenium IDE plugin",
    version: "1.0.0",
    commands: [
      {
        id: "successfulCommand",
        name: "successful command"
      },
      {
        id: "failCommand",
        name: "failed command"
      }
    ]
  }
});

I tried to check with simpler calls to the api like:

chrome.runtime.sendMessage("mooikfkahbdckldjjndioackbalphokd", {
  uri: "/project",
  verb: "get" });

but the result is the same.

I honestly do not know what kind of response I should get to the /register call but for the /project one it should look like this:

{
  id: "auto-generated-project-id",
  name: "your-project-name"
}

But I just get "<-undefined" bellow my script and nothing else.

like image 207
Enrique Garcia-Herrera Avatar asked Dec 06 '25 16:12

Enrique Garcia-Herrera


1 Answers

I have solved this problem.

My question was made from the wrong perspective from the start

I tried to add the commands by executing those scripts from the console and that is not how it works. The way to do it is to create an browser extension which executes the scripts when it starts. My solution right now was made on Firefox because how easy it was to create a temporal add-on.

Follow this guide to do this.

On the .js file that the manifest references, insert the script to register and it will be added to selenium-IDE choices of commands.

This solution should work on chrome, with its own way of making add-ons, which I will try next.

like image 61
Enrique Garcia-Herrera Avatar answered Dec 08 '25 12:12

Enrique Garcia-Herrera



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!