使用Selenium Webdriver自动化用例测试asp页面。
环境是Ubuntu 14.04 64bit Firefox46.0 使用selenium grid进行测试 selenium server版本为 selenium-server-standalone-2.53.0.jar
开发语言为 Selenium Webdriver Java API,版本是
org.seleniumhq.selenium
selenium-java
2.48.2
当代码调用到:
driver.switchTo().frame("xxx");
出现下面的异常信息:
Exception in thread "main" org.openqa.selenium.WebDriverException: Permission denied to access property Symbol.toPrimitive
Build info: version: '2.53.0', revision: '35ae25b', time: '2016-03-15 17:00:58'
System info: host: 'soho-71', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '3.16.0-38-generic', java.version: '1.7.0_80'
Driver info: driver.version: unknown
Command duration or timeout: 16 milliseconds
Build info: version: '2.48.2', revision: '41bccdd10cf2c0560f637404c2d96164b67d9d67', time: '2015-10-09 13:08:06'
System info: host: 'pasture', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '3.16.0-53-generic', java.version: '1.8.0_91'
Driver info: org.openqa.selenium.remote.RemoteWebDriver
Capabilities [{applicationCacheEnabled=true, rotatable=false, databaseEnabled=true, handlesAlerts=true, version=46.0, platform=LINUX, nativeEvents=false, acceptSslCerts=true, webdriver.remote.sessionid=a64b1318-004d-4f80-8d81-077e9e27a107, locationContextEnabled=true, webStorageEnabled=true, browserName=firefox, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true}]
Session ID: a64b1318-004d-4f80-8d81-077e9e27a107
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:647)
at org.openqa.selenium.remote.RemoteWebDriver$RemoteTargetLocator.frame(RemoteWebDriver.java:962)
at org.openqa.selenium.remote.RemoteWebDriver$RemoteTargetLocator.frame(RemoteWebDriver.java:957)
at webpages.b1.B1VersionOpt.checkVersion(B1VersionOpt.java:47)
at testsuite.T08_01_01_01_B1RemoteUpgradeTestSuite.
(T08_01_01_01_B1RemoteUpgradeTestSuite.java:117)
at testsuite.MainEntry.main(MainEntry.java:151)
Caused by: org.openqa.selenium.WebDriverException: Permission denied to access property Symbol.toPrimitive
Build info: version: '2.53.0', revision: '35ae25b', time: '2016-03-15 17:00:58'
System info: host: 'soho-71', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '3.16.0-38-generic', java.version: '1.7.0_80'
Driver info: driver.version: unknown
Build info: version: '2.48.2', revision: '41bccdd10cf2c0560f637404c2d96164b67d9d67', time: '2015-10-09 13:08:06'
System info: host: 'pasture', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '3.16.0-53-generic', java.version: '1.8.0_91'
Driver info: driver.version: unknown
at .addEventListener()
使用google能够查看很多类似的问题和解决方法,我几乎都尝试了,但都没有解决。
有些文章上提到,这个是selenium的bug,然后好像也没看到如何解决的云云
突发奇想,将firefox的环境更换为chrome环境( 版本50.0.2661.86(64bit) ),问题解决!
原因不明,如果有同学了解,请帮忙以评论的方式反馈下,谢谢!
阅读(2042) | 评论(0) | 转发(0) |