我正在尝试设置Web应用程序的测试 - 我在Docker和PHPUnit 5.7.19中拥有带有VNC的Selenium独立3.2服务器。PHPUnit抛出异常,当应该没有
然而一行
$this->webDriver->findElement(WebDriverBy::xpath($main_button_xpath))->click();
有时会抛出(但有时不)一个异常时,它不应该 - 我已经通过VNC看着它和目标按钮被看见并且是存在在屏幕上它仍然抛出异常。自从我从2.57升级Selenium服务器后,这些错误开始出现。
你有什么想法如何修复或更好地调试吗?
非常感谢您
编辑:异常
The element reference is stale. Either the element is no longer attached to the DOM or the page has been refreshed.
For documentation on this error, please visit: http://seleniumhq.org/exceptions/stale_element_reference.html
Build info: version: '3.2.0', revision: '8c03df6', time: '2017-03-02 09:34:51 -0800'
System info: host: 'dbcbaf52ae71', ip: '172.17.0.3', os.name: 'Linux', os.arch: 'amd64', os.version: '3.10.0-514.10.2.el7.x86_64', java.version: '1.8.0_121'
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Capabilities [{moz:profile=/tmp/rust_mozprofile.JUP1ydgC8zCR, rotatable=false, timeouts={implicit=0, page load=300000, script=30000}, pageLoadStrategy=normal, platform=ANY, specificationLevel=0, moz:accessibilityChecks=false, acceptInsecureCerts=false, browserVersion=52.0, platformVersion=3.10.0-514.10.2.el7.x86_64, moz:processID=17210, browserName=firefox, platformName=linux}]
Session ID: 47bf2157-c7a8-47ea-a82a-3ab3ddd0ee61
您是否有实际异常消息和堆栈跟踪的示例? – segFault
@segFault添加了异常 –