When I run selenium tests using the Chrome browser, all my tests pass fine. When using the phantomjs browser, it would seem that the browser session would not get reset after each test case. In my tests, I log in as a user to go to specific pages and then log out. The problem occurs when the test case fails. The browser session is not reset, so when the next test case starts, the failed test could not log out. This leads to the fact that all test cases fail after one failure.
When searching the Internet for a solution to this problem, sine 2013 was known. I cannot find anything on this issue that was recent. Are there any modern workarounds?
In manual mode, deleting cookies before or after each test case does not work. webDriver.manage().deleteAllCookies();
I am using phantomjs ver 2.1.1.
source
share