2

I've been learning Robot Framework with Selenium2Library lately, and I've one little problem.

I try to Add cookie to website opened in Chrome, and then retrieve its value to make sure it's equal to expected value.

resources.txt:

    *** Settings ***
Library           Selenium2Library
Library           OperatingSystem

*** Variables ***
${browser}        chrome

cookieKeywords:

*** Settings ***
Resource          resources.txt

*** Variables ***
${CookieValue}    ${EMPTY}
${ExpectedCookieValue}    somevalue

*** Test Cases ***
CookieTest
    Open Browser    http://www.google.pl    ${browser}
    Add Cookie    CookieTest    somevalue
    ${CookieValue}    Get Cookie Value    CookieTest
    Should Be Equal    ${CookieValue}    ${ExpectedCookieValue}    "Cookie is equal"
    Close Browser

Screen with project tree and error

It looks like I can't add temporary cookies to website opened with chrome...

Maybe someone have occured the same problem?

sideshowbarker
  • 81,827
  • 26
  • 193
  • 197
  • 1
    I have just tested your code and it worked fine (also with Firefox). I even tried different URL, like https://www.google.com/. Just make sure you have the latest Chromedriver. – Helio Jun 26 '17 at 12:36
  • I've tried it on another computer and it worked, so I tried to reinstal Chrome and it worked, webdriver was still the same, so maybe version of browser was the problem. –  Jun 26 '17 at 20:13

1 Answers1

1

Reinstalling Chrome browser helped :)