在 Firefox 47.0.2
上执行选择selenium命令时,selenium会抛出此异常以下是我尝试执行的硒代码
Select select = new Select(driver.findElement(By.xpath(".//select[contains(@id,'name-title')]")));
select.selectByVisibleText(title);
以下是控制台日志
org.openqa.selenium.JavascriptException: Error: Permission denied to access
property "navigator" Build info: version: '3.0.1', revision: '1969d75',
time: '2016-10-18 09:49:13 -0700' System info: host: 'Viral', ip: '192.168.3.3', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0',
java.version: '1.8.0_73' Driver info:
org.openqa.selenium.firefox.FirefoxDriver Capabilities [{rotatable=false,
raisesAccessibilityExceptions=false, marionette=true, firefoxOptions={args=
[], profile=UEsDBBQACAgIAEusd0kAAAAAAAAAAAAAAAAHAAAAdXNlci5qc52WS2/bMAzH7/sUQ04bsAh9rIdup67tgAHFOjQoehRkibbVyJKmR9x8+1F+LGnt2G1PiW1REskf/2T04Kh1kH9aZM7U+EQ8y6H5L3VBKqZq5oCAZpkCsfjyMWfKw+fvH+LOUrCAa6xxIZmUwFQo22eCizaSz9hrCLVxa1KGYIktpS+3y/TZMu+XCnQRSjQ8OTt7btZf2AET+CMgAA8gfkrnwwXehStAs+Diy+uaCv16orx0pgLquZM2UBc1DbJKJovz8/PF+FnC1FoZJgh+u+r+X0k3ek5vE1jmCUZR3+pLZTyMB2FwQsU0K1I+SlM/lKBXGOQU4HFzi77Y4NNhtDKCqZmUwSYYozwB54zjRnuj9rM09MbLQhuNwa6gysCtmkc/7YsH7yWuCgYRcuAjhjvHi1LumC+nbZXUa2IsaApPAZxmKjHwZvDyRMNd1OOH1ZAJJzf4zDgHpCBq9NwjRZSDC340Es9wxfdLzng5l1XprWJbENfHR6vfBuFMBl/HF+MrcasfpEYW/PERkXgpc393k9BkmYnhW6aYXi+GWLfOU6YUffQYuOSTbNM09OPJSkwNriV1KQMo6QNu8DdKd4iahMxaBtJFoCcUnUvcTBaBYphErLFpLH1iPFpSYmFa3JvWoHgq0uhS+hdzVZkbhVJwg54MYUkY6QZHEi2SA0RjHvLtPS55s65Fm867nvQFeHQybBFBBfiP+OAkD9Q4WUhNrVGSb6ep0VBjPZPO+YnUP7touzNJL1cxq2RTg3+alxcN5a/T8dFtJj3+X/ZdFlMGceXRXIGjm3UD+zBpJs9xHSyZtZ4gqqam2ZYKyFlUYVyn+rBzbzvYxm875GESzZ59LBSUwOC2pJXcZv3J3NrJrfuIXN/fXJBTwnZJGrr3yDas7ViTav0yFX1BTXM0vLeDx6apTh7SYpq2n/ZzL+IsBnPVysaKIwRJoY6PDolzuyvVLOAjhQ3oA9I80nJvkbDZ62TK8HUjgK9KlAfmeNlhM9fOK9LCTUSs7GTSEPJXofiMF4MBclKMq+9Ag16Kz+l4a2uVfdlXH1IU4kyv79YeUJZu5HrVrLXXlH0zMuyaMopQhPFpay94Ca7xe+xVj2k7YzNe/dKX7QR0cF7sWhxt9EpgJHVBUweY4aQE7K44HPD1VStZP9ovb+9+hAkh043ZTC8YHePfO74rUxTpZTcgTqr/Xjk1Hl+iOmLBZlIlALUsyqAO9Ls90/7E94gb7WuBVDhyNiwu0pjq4EWMdpNPmmqRbZxNZ0afXemr3EfbDgG7oeQfUEsHCAi6boDFAwAASA0AAFBLAQIUABQACAgIAEusd0kIum6AxQMAAEgNAAAHAAAAAAAAAAAAAAAAAAAAAAB1c2VyLmpzUEsFBgAAAAABAAEANQAAAPoDAAAAAA==}, appBuildId=20161031133903, version=, platform=XP, proxy={}, command_id=1, specificationLevel=0, acceptSslCerts=false, browserVersion=47.0.2, platformVersion=10.0, XULappId={ec8030f7-c20a-464f-9b0e-13a3a9e97384}, browserName=Firefox, takesScreenshot=true, javascriptEnabled=true, takesElementScreenshot=true, platformName=Windows_NT, device=desktop, firefox_profile=UEsDBBQACAgIAEusd0kAAAAAAAAAA...}] Session ID: 27ed58ca-ca52-4f64-bce3-22d77768b1e4 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:422) at org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:127) at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:93) at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:42) at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:163) at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:82) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:601) at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:274) at org.openqa.selenium.remote.RemoteWebElement.getAttribute(RemoteWebElement.java:126) at org.openqa.selenium.support.ui.Select.<init>(Select.java:52) at AirLines.App.main(App.java:261) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)