我最近一直在学习Selenium2Library的Robot Framework,我有一个小问题。
我尝试将Cookie添加到在Chrome中打开的网站,然后检索其值以确保它等于预期值。
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
看起来我无法向使用chrome打开的网站添加临时cookie ...
也许有人发生了同样的问题?
答案 0 :(得分:1)
重新安装Chrome浏览器有助于:)