question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Having trouble adding cookies...

See original GitHub issue

Hello, 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:closed
  • Created 10 years ago
  • Comments:12 (8 by maintainers)

github_iconTop GitHub Comments

4reactions
juliemrcommented, Dec 12, 2013

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.

3reactions
sssalib42commented, Jun 22, 2015

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found