Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Protractor - how to call the WebDriver methods?

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

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?

like image 835
mariachimike Avatar asked Aug 24 '14 08:08

mariachimike


People also ask

Can you name some of the methods under WebDriver?

Selenium WebDriver interface has many abstract methods like get(String url), quit(), close(), getWindowHandle(), getWindowHandles(), getTitle() etc. WebDriver has nested interfaces like Window , Navigation , Timeouts etc. These nested interfaces are used to perform operations like back(), forward() etc.

Does Protractor use WebDriver?

Protractor is a wrapper around Selenium Webdriver that provides an automation test framework, which simulates user interaction with an Angular web application for a range of browsers and mobile devices. It provides all features of Selenium WebDriver along with Angular specific features for seamless end to end testing.

How do I get a browser title on a Protractor?

Protractor Browser Commands - Get current page title in Protractor. Purpose: The getTitle() function in ProtractorBrowser class is used to get the current page title.

Can we integrate Protractor with selenium?

Protractor make use of Selenium Grid to initialize, control and run browser instance. Can easily integrate with jasmine, mocha and cucumber framework to write your test.


1 Answers

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

like image 60
Miyuki Avatar answered Sep 18 '22 12:09

Miyuki