带有 safaridriver 的 Selenium 3.0.1 在 waitForElementVisible() 上失败
Selenium 3.0.1 with safaridriver failing on waitForElementVisible()
野生动物园 10.0.1
macOS 塞拉
当运行ning Codeception命令时:
$I->waitForElementVisible(['css' => 'input[type=text][id=UserUsername]'], 30);
在使用 Selenium 3.0.1 的 Safari 中进行验收测试时,我收到错误消息。失败时截取的屏幕截图清楚地显示了有问题的元素。同样的 test/command 在 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
当我使用 Selenium 2.53.1 运行 Safari/Firefox/Chrome 中的相同 test/command 时,它找到的元素没有问题。
是否存在我在浏览论坛时未发现的此类定位器的已知问题?有人对如何使这项工作有建议吗?
更新 12-01-16:现在这似乎更像是 waitForElementVisible() 命令的问题,而不是定位器。如果我将命令更改为 $I->waitForElement(['css' => 'input[type=text][id=UserUsername]'], 30);
,则测试会成功向前移动,直到下一个 waitForElementVisible() 命令。
People say visibility checks are broken in the release version of Safari 10. You can try Safari Technology Preview, and if your issue is still there, we can conclude it's some other issue, not the broken visibility checks. If your issue is gone, it'll be not exactly your users' experience, but better than nothing anyways. Also you can try implementing your own visibility checks as a workaround using some script on the browser's side (e.g. this function 看起来不错)。
为了 运行 您在 Safari Technology Preview 中的测试,添加
'safari.options': { technologyPreview: true }
能力。
另请参阅有关此主题的 。
野生动物园 10.0.1 macOS 塞拉
当运行ning Codeception命令时:
$I->waitForElementVisible(['css' => 'input[type=text][id=UserUsername]'], 30);
在使用 Selenium 3.0.1 的 Safari 中进行验收测试时,我收到错误消息。失败时截取的屏幕截图清楚地显示了有问题的元素。同样的 test/command 在 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
当我使用 Selenium 2.53.1 运行 Safari/Firefox/Chrome 中的相同 test/command 时,它找到的元素没有问题。
是否存在我在浏览论坛时未发现的此类定位器的已知问题?有人对如何使这项工作有建议吗?
更新 12-01-16:现在这似乎更像是 waitForElementVisible() 命令的问题,而不是定位器。如果我将命令更改为 $I->waitForElement(['css' => 'input[type=text][id=UserUsername]'], 30);
,则测试会成功向前移动,直到下一个 waitForElementVisible() 命令。
People say visibility checks are broken in the release version of Safari 10. You can try Safari Technology Preview, and if your issue is still there, we can conclude it's some other issue, not the broken visibility checks. If your issue is gone, it'll be not exactly your users' experience, but better than nothing anyways. Also you can try implementing your own visibility checks as a workaround using some script on the browser's side (e.g. this function 看起来不错)。
为了 运行 您在 Safari Technology Preview 中的测试,添加
'safari.options': { technologyPreview: true }
能力。
另请参阅有关此主题的