0

Just started using the Robot Framework to test our application and I really like it so far. The option to combine it with Selenium, Appium and Locust.io in the end sounds appealing. Anyhow, I have a basic question:

I'm trying to log the cookies from a browser session to the console. Selenium2Library provides the keyword:

Get Cookies

Then I try in my test case:

Log Cookies To Console
    ${cookies}=    Get Cookies
    Log To Console  ${cookies}

This doesn't seem to give me anything in the console.

mathijsbrand
  • 413
  • 2
  • 16

1 Answers1

2

Are you 100% sure there is an cookie anyway?

What I would do it :

  • try with another URL on which you know there actually is a cookie (www.google.com?)
  • try to add a cookie (keyword: add cookie) just before you log, so that you can see, at least, that the one you add is displayed

That could help you find out the source of your problem.

Laurent Bristiel
  • 6,819
  • 34
  • 52
  • add cookie mycookie something ${cookies}= Get Cookies Log To Console ${cookies} – mathijsbrand Feb 12 '15 at 18:54
  • You turned out to be right about this. Somehow it didn't log the cookies at first. It was only after I deleted my cookie jar that the Get Cookies command resulted in anything. Thanks! – mathijsbrand Feb 12 '15 at 19:44