量角器 - 如何调用WebDriver方法?

[英]Protractor - how to call the WebDriver methods?


I'm trying to use the deleteAllCookies() function from WebDriver from a Protractor test spec.

我正在尝试使用Protractor测试规范中WebDriver的deleteAllCookies()函数。

I've tried:

我试过了:

browser.driver.deleteAllCookies(); // undefined error
browser.driver.options.deleteAllCookies(); // undefined error
browser.manage().deleteAllCookies(); // doesn't seem to be deleting cookies

How do I call/use this function correctly?

如何正确调用/使用此功能?

2 个解决方案

#1


5  

This works for me with protractor 1.5.0, selenium-webdriver: "2.44.0" browser.driver.manage().deleteAllCookies();

这适用于量角器1.5.0,selenium-webdriver:“2.44.0”browser.driver.manage()。deleteAllCookies();

#2


4  

In protractor the way to delete all your cookies is:

在量角器中,删除所有cookie的方法是:

ptor.manage().deleteAllCookies();

注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:http://www.itdaan.com/blog/2014/08/24/1687038fa32b413e41a70a41ecc8ac45.html



 
© 2014-2018 ITdaan.com 粤ICP备14056181号