开发者

Clearing cookies between selenium HTML tests?

开发者 https://www.devze.com 2023-03-24 00:20 出处:网络
I\'m running my HTML tests as such with selenium-server 2.2: java -jar /var/lib/selenium/selenium-server.jar -ensureCleanSession -htmlSuite *firefox http://$HOST ./test/selenium/html/TestSuite.html ./

I'm running my HTML tests as such with selenium-server 2.2:

java -jar /var/lib/selenium/selenium-server.jar -ensureCleanSession -htmlSuite *firefox http://$HOST ./test/selenium/html/TestSuite.html ./target/selenium/html/TestSuiteResults.html

For some reason, I can't seem 开发者_运维技巧to get cookies to clear between individual tests in a test suite. Is there anything I can do to clear cookies between tests?


Maybe I am over-simplifying, but if you are aware of the domain in which your tests are running (and in turn, need to clear the cookies off them), you could use selenium.deleteAllVisibleCookies(); as your final and initial test condition, between iterations.

0

精彩评论

暂无评论...
验证码 换一张
取 消