Reputation: 5052
While the vast majority of the time I'm happy to have the browser tests running fast (and headless), on occasion it would be extremely valuable to be able to pass a switch to the tests that slowed the process down and maybe even highlighted the mouse before clicking.
The largest use case for this is demonstrating and communicating the value of said tests to decision makers--something that is hard to do when the windows cycle so quickly they can't begin to understand what is happening.
Upvotes: 2
Views: 545
Reputation: 2938
Hi please do it like below
WebDriver driver = new FirefoxDriver();
EventFiringWebDriver slowDriver = new EventFiringWebDriver(driver);
slowDriver.registerListener(new ListenerThatAddsPauses(5, TimeUnit.SECONDS));
You will have to write your class ListenerThatAddsPauses which will extend AbstractEventFiringListener. In ListenerThatAddsPauses you will have to override methods from parent class and for example add needed pauses. Something like:
@Override
public void beforeClickOn(WebElement element, WebDriver driver) {
Thread.sleep(timeout);
}
also here i found a example please have a look at it may be this helps you http://seleniumworks.blogspot.in/2014/02/eventfiringwebdriver.html
Upvotes: 3
Reputation: 2333
Install VNC on your selenium server then you can just watch them happen.
If you want to slow it down you could do a sleep(1) in a core framework function such as click() or whatnot, to slow down even further.
Upvotes: 1