10/25/2011

Little cheat to speed up your WebDriver tests

While most examples for Selenium WebDriver use creating new instance of browser on setUp() and closing it on tearDown(), it is not that fast really. So, in most cases, you only need to clear cookies and open homepage. Fortunately, WebDriver allows this. Such a little cheat will significantly decrease the time your tests take to run.

You can clear cookies by driver.manage.delete_all_cookies (Ruby bindings). In Watir-WebDriver there is also cute clear_cookies() method. Just create a new instance of WebDriver before all the tests and clear cookies in setUp(). That's it.

1 comments:

aparna john said...

Hi,The web-based applications have already come to grips with Registered Agents in Qatar reality. Where a download of a document to your favorite word processor was once just fine, the market now demands data re-use and expanded business process integration, Thanks....

Post a Comment