vbot icon indicating copy to clipboard operation
vbot copied to clipboard

Ability to execute script on chrome instance before running tests.

Open LukaszKiedrowski opened this issue 6 years ago • 1 comments

Hi!

I was looking for solution to set up sessionStorage of the browser before running VRT but I cannot find it.

What do you think about ability to execute js script on chrome instance before running tests?

kind regards, Lucas K.

LukaszKiedrowski avatar May 07 '18 17:05 LukaszKiedrowski

Actually I have found way to do it.... :) it would be good if you can add method for it or atleast add code below to documentation

vbot.on('scenario.start', () => {
      vbot
       .chromejs
       .eval('window.sessionStorage.setItem("example_name", "this is example var value!")');
            
     vbot
     .chromejs
     .eval('window.alert(window.sessionStorage.getItem("example_name"))');
});

LukaszKiedrowski avatar May 07 '18 18:05 LukaszKiedrowski