How can I clear cookies for each tests in my PhantomJS + GhostDriver + Selenium WebDriver + WebDriver Client system?
My test process looks like this:
- Start selenium-web-driver-standalone in hub role.
- Start phantomjs in webdriver mode and attach it to selenium webdriver.
- Start shell script that iterates over tests suites and start each.
- Each test uses webdriver client and communicate with browser connected to selenium web driver.
When I use firefox browser instead of phantomjs all tests passed ok. But when I switch to using phantomjs as browser all tests that checked registration failed because cookies already set after first test execution. Can I clear all cookies on every test start up? Or I should to restart phantomjs process on every separate test (as this is with firefox and selenium webdriver in not hub role)?