我是硒的新手。实际上我正在做一些cookie验证项目,这需要我在多个浏览器(Firefox,即chrome,safari)中单击某些同意链接之前和之后手动检查存在的cookie。
之前在第 1 阶段项目中,我运行了一个 qtp 脚本来将 firefox 视为窗口对象并捕获屏幕截图,但如果分辨率发生变化或任何细微的外观变化,这将非常麻烦。此外,它也很难管理,它只能在 Firefox 上运行,我需要再次为 chrome 和 safari 编写相同的脚本。除此之外,由于 QTP 是许可产品,目前我们使用的是单机许可,因此我无法在多台机器上运行它以加快执行速度。
所以我想搬到 Selenium。目前我的要求是:
1. open the page - take the screenshot once page loaded.
2. check the cookies using firebug or any other way - take the screenshot
3. click the link to close the consent - take screenshot once consent closed.
4. refresh the page and again check the cookies using firebug - take screenshot
所以我对 selenium 做了一些研究,发现我可以使用 verifyCookie 验证 cookie,但我仍然需要 cookie 的萤火虫窗口截图。所以我被困在这里。
请帮我在这里..
我在 Firefox 上找到了一些可能的方法,但现在我期待在 Chrome 上找到类似的方法,如果可能的话。谢谢