Selenium 3.0.1与safaridriver在waitForElementVisible()上失败

Safari 10.0.1 macOS Sierra

运行Codeception命令时:

$I->waitForElementVisible(['css' => 'input[type=text][id=UserUsername]'], 30);

在使用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 

当我使用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技术预览中运行测试,请添加

'safari.options': { technologyPreview: true }

到能力。

另见我在这个问题上的其他答案。

链接地址: http://www.djcxy.com/p/83581.html

上一篇: Selenium 3.0.1 with safaridriver failing on waitForElementVisible()

下一篇: How can Selenium batch many isElementDisplayed calls?