Cos*_*teN 2 safari selenium selenium-webdriver safaridriver codeception
Safari 10.0.1 macOS Sierra
运行Codeception命令时:
$I->waitForElementVisible(['css' => 'input[type=text][id=UserUsername]'], 30);
Run Code Online (Sandbox Code Playgroud)
在使用Selenium 3.0.1的Safari验收测试中,我收到错误消息.失败时拍摄的屏幕截图清楚地显示了相关元素.Firefox和Chrome中的相同测试/命令都是成功的.错误:
Screenshot saved to /Applications/MAMP/htdocs/AutomatedTests/tests/_output/debug/FAILED1479307207.png
Unable to retrieve Selenium logs : The command 'GET /session/9BC56414-8934-4315-9293-B6E99720E318/log/types' is not implemented.
Command duration or timeout: 3 milliseconds
Build info: version: '3.0.1', revision: '1969d75', time: '2016-10-18 09:48:19 -0700'
System info: host: 'Cosettes-MacBook-Pro.local', ip: '10.0.1.75', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.12.1', java.version: '1.8.0_101'
Driver info: org.openqa.selenium.safari.SafariDriver
Capabilities [{applicationCacheEnabled=true, rotatable=false, databaseEnabled=true, handlesAlerts=true, version=12602.2.14.0.5, cleanSession=true, platform=MAC, nativeEvents=true, locationContextEnabled=false, webStorageEnabled=true, browserName=safari, javascriptEnabled=true, cssSelectorsEnabled=true}]
Session ID: 9BC56414-8934-4315-9293-B6E99720E318
Screenshot and page source were saved into '/Applications/MAMP/htdocs/AutomatedTests/tests/_output/' dir
ERROR
Run Code Online (Sandbox Code Playgroud)
当我使用Selenium 2.53.1在Safari/Firefox/Chrome中运行相同的测试/命令时,它会找到没有问题的元素.
这种类型的定位器是否存在已知问题,我在通过论坛时找不到?有人建议如何使这项工作?
更新12-01-16:现在看起来这更像是waitForElementVisible()命令而不是Locator的问题.如果我将命令更改为$I->waitForElement(['css' => 'input[type=text][id=UserUsername]'], 30);
测试成功向前移动直到下一个waitForElementVisible()命令.
人们说在Safari 10的发布版本中可见性检查被破坏了.您可以尝试使用Safari技术预览版,如果您的问题仍然存在,我们可以得出结论是其他问题,而不是可见性检查损坏.如果您的问题消失了,那将不仅仅是您的用户体验,而是总比没有好.此外,您可以尝试使用浏览器侧的某些脚本实现您自己的可见性检查作为解决方法(例如,此功能看起来足够好).
要在Safari Technology Preview中运行测试,请添加
'safari.options': { technologyPreview: true }
Run Code Online (Sandbox Code Playgroud)
能力.
归档时间: |
|
查看次数: |
998 次 |
最近记录: |