Executor class usage with JavaScript

12 views
Skip to first unread message

Арман Белялов

unread,
Jun 23, 2021, 11:28:26 PM6/23/21
to Selenium Users
Hi guys,
I was trying to create a custom command that would run  a script and tried to implement it using the Command() and Executor() classes (located  in 'selenium-webdriver/lib/command ').

I was able to create a custom command with the Command class but couldn't run it with the Executor.
Can you give me an advise on this please?

Here's the code that I'm trying to run:
                             let doIt = new Command('doIt');
            doIt.setParameter('remove', ()=>{
                console.log("Remove func is called");
                return "Some result";
            });
            let exec = new Executor();
            let result = await exec.execute(doIt);

Thank you!
Reply all
Reply to author
Forward
0 new messages