如何解决“权限被拒绝访问属性”调用“”?

问题描述:

码 -如何解决“权限被拒绝访问属性”调用“”?

Select Gender = new Select(driver.findElement(By.xpath("//select[@id='gender']"))); 
Gender.selectByValue("Male"); 

错误 -

`Exception in thread "main" org.openqa.selenium.WebDriverException: **Permission denied to access property "invoke"** 

Build info: version: '3.4.0', revision: 'unknown', time: 'unknown' 

System info: host: 'COMP2-PC', ip: '192.168.1.9', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_91' 

Driver info: org.openqa.selenium.firefox.FirefoxDriver 

Capabilities [{rotatable=false, raisesAccessibilityExceptions=false, appBuildId=20161123182536, version=50.0.1, platform=XP, proxy=Proxy(), command_id=1.0, specificationLevel=0.0, acceptSslCerts=false, processId=2380.0, browserVersion=50.0.1, platformVersion=6.1, XULappId={ec8030f7-c20a-464f-9b0e-13a3a9e97384}, browserName=firefox, takesScreenshot=true, takesElementScreenshot=true, javascriptEnabled=true, platformName=windows_nt}] Session ID: c1e4da76-9f21-45aa-a1b8-f21a9e8dd088  

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)  
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)  
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)  
at java.lang.reflect.Constructor.newInstance(Unknown Source)  
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException 
(W3CHttpResponseCodec.java:150)  
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode 
(W3CHttpResponseCodec.java:115)  
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode 
(W3CHttpResponseCodec.java:45) 
at org.openqa.selenium.remote.HttpCommandExecutor.execute 
(HttpCommandExecutor.java:164) 
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute 
(DriverCommandExecutor.java:82)  
at org.openqa.selenium.remote.RemoteWebDriver.execute 
(RemoteWebDriver.java:637) 
at org.openqa.selenium.remote.RemoteWebElement.execute 
(RemoteWebElement.java:272)  
at org.openqa.selenium.remote.RemoteWebElement.getAttribute 
(RemoteWebElement.java:124)  
at org.openqa.selenium.support.ui.Select.<init>(Select.java:52)  
at AppInformationTest.main(AppInformationTest.java:70) ` 

虽然试图自动化(选择下拉值)与硒的webdriver我就遇到了这个问题。

  • 工具版本*: Java的 - 1.8.0_91, 日食 - 释氧(4.7.0), Mozilla Firefox浏览器 - 50.01, 壁虎司机v0.17.0-Win64中....请帮我理清!
+1

对不起,这不是StackOverflow的是如何工作的。请参加[旅游],访问[帮助]并阅读[问]以了解如何有效地使用本网站。您必须发布您的代码和任何错误消息,但作为文本而不是图像。您的帖子中没有足够的信息可供任何人帮助您。 –

这是浏览器specfic问题,请使用Chrome进行试用。按照此链接查看更多

Reference Link for your issue