2

I want to run particular protractor test and be able to watch and understand what the test are doing on the user interface.

But the different actions is done too fast for me. So is there a way to reduce speed like in selenium ?

Manu
  • 91
  • 2
  • 7
  • 1
    possible duplicate of [Can protractor be made to run slowly?](http://stackoverflow.com/questions/24960290/can-protractor-be-made-to-run-slowly) – Juho Vepsäläinen Oct 18 '14 at 14:17
  • the solution proposed in this thread is not so good. I do not want to write ptor.sleep(6000);everywhere in my test but play the entire test slowly... – Manu Oct 18 '14 at 14:26
  • I cannot see a simple way to slow down tests but they provide some debugging aids at least, https://github.com/angular/protractor/blob/master/docs/debugging.md . – Juho Vepsäläinen Oct 18 '14 at 14:42

2 Answers2

2

As discussed here, the ability to slow down Webdriver tests was removed for all bindings. A quick google search will tell you you're not alone in wanting this feature, and I would include myself. Sahi has this ability (setSpeed(int interval)), and it comes in handy for debugging, presentations, etc...

Toward that end, I suggest adding an enhancement request to the Protractor folks...

Community
  • 1
  • 1
Brine
  • 3,733
  • 1
  • 21
  • 38
0

We can slow down the execution speed using the following simple steps which I have achieved

Step 1:Create a custom config file eg:customConfig.js on the project and put the following code there

var origFn = browser.driver.controlFlow().execute;
browser.driver.controlFlow().execute = function () {
    var args = arguments;   
    origFn.call(browser.driver.controlFlow(), function () {
        //increase or reduce time value, its in millisecond
        return protractor.promise.delayed(200);
    }); 
    return origFn.apply(browser.driver.controlFlow(), args);
};

Step 2:Register this code inside the conf.js file under the specs section

 specs: ['customConfig.js','index.js'],
sarath
  • 1
  • 1