Having trouble adding cookies...
See original GitHub issueHello, I am trying to do a very simple add and retrieve cookie test:
describe("Homepage", function () {
var ptor;
beforeEach(function () {
ptor = protractor.getInstance();
browser.get('/');
ptor.manage().addCookie("test", "value");
});
it('should have cookie named test', function () {
cookies = ptor.manage().getCookie("test").then(function(data){
console.log(data);
});
});
});
The console prints out null
and I can’t figure out why… I would really appreciate any help on this.
Issue Analytics
- State:
- Created 10 years ago
- Comments:12 (8 by maintainers)
Top Results From Across the Web
Turn cookies on or off - Computer - Google Account Help
On your computer, open Chrome. · At the top right, click More More and then Settings. · Under "Privacy and security," click Site...
Read more >How to enable cookies on your mobile device - OverDrive | Help
Go to More menu > Settings > Site settings > Cookies. You'll find the More menu icon in the top-right corner. Make sure...
Read more >Enabling Cookies in Your Browser
Enabling Cookies in Your Browser ; Internet Explorer. Click 'Tools' (the gear icon) in the browser toolbar. Choose Internet Options. ; Safari. Click...
Read more >Enable cookies in your web browser
Click "Site Settings". Click "Cookies and site data". In the Privacy and security section, click Content Settings. Click the slider to "Allow ...
Read more >Enable cookies - Microsoft Support
In the Content settings dialog box, under Cookies, make sure Allow local data to be set (recommended) is selected. Select Done and refresh...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Please ask questions like this on StackOverflow! You can tag with #protractor http://stackoverflow.com/questions/tagged/protractor
Buuut since you’re already here - check out https://github.com/angular/protractor/blob/master/spec/login/viaTestSpec.js to see cookies being used.
Just a quick update: the link to https://github.com/angular/protractor/blob/master/spec/login/viaTestSpec.js is 404 not found. I believe that the file was renamed and here is what the folder includes now: https://github.com/angular/protractor/blob/master/spec/login/login_spec.js