加载SessionSnapshot无法正常工作,无法设置Cookie

时间:2016-05-16 08:57:05

标签: php cookies selenium-webdriver webdriver codeception

我在使用codecpetion进行验收测试时遇到了问题。 我尽量避免每次使用快照登录,但每次我尝试运行测试时都会看到:

 1. $I->loadSessionSnapshot("login")
...
 [Facebook\WebDriver\Exception\InvalidCookieDomainException] You may only set cookies for the current domain

来自selenium服务器的日志(请注意第二行中域之前的点):

  [Selenium client Logs]
  10:28:09.7 INFO - org.openqa.selenium.remote.server.DriverServlet org.openqa.selenium.remote.server.rest.ResultConfig.handle Done: [add cookie: device_view=full; expires=Cz, 16 cze 2016 12:00:00 CEST; path=/; domain=foo.example.com]
  10:28:09.8 INFO - org.openqa.selenium.remote.server.DriverServlet org.openqa.selenium.remote.server.rest.ResultConfig.handle Executing: [add cookie: _gat_UA-58964912-1=1; expires=Pn, 16 maj 2016 10:38:03 CEST; path=/; domain=.foo.example.com])
  10:28:09.16 WARNING - org.openqa.selenium.remote.server.DriverServlet org.openqa.selenium.remote.server.rest.ResultConfig.handle Exception thrown
  10:28:09.17 WARNING - org.openqa.selenium.remote.server.DriverServlet org.openqa.selenium.remote.server.rest.ResultConfig.handle Exception: You may only set cookies for the current domain
  Build info: version: '2.53.0', revision: '35ae25b', time: '2016-03-15 17:00:58'
  System info: host: 'foobar', ip: '123.456.78.90', os.name: 'Windows 8.1', os.arch: 'amd64', os.version: '6.3', java.version: '1.8.0_66'
  Driver info: driver.version: unknown

我该怎么办?

0 个答案:

没有答案