我试过的代码:
//Resolve a particular URL
List<WebElement> fields = driver.findElements(By.xpath("<xpath>")); //find multiple elements and store into array list.
WebDriverWait wait = new WebDriverWait(driver, 15);
wait.until(ExpectedConditions.visibilityOfAllElements(fields));
我收到的例外情况:
访问财产的权限被拒绝&#34; _wrapped&#34;构建信息:版本: &#39; 3.0.1&#39;,修订版:&#39; 1969d75&#39;,时间:&#39; 2016-10-18 09:48:19 -0700&#39;系统 info:host:&#39; 207-254-7-224&#39;,ip:&#39; 207.254.7.224&#39;,os.name:&#39; windows&#39;, os.arch:&#39; x86&#39;,os.version:&#39; 6.1&#39;,java.version:&#39; 1.8.0_101&#39;司机 info:org.openqa.selenium.firefox.FirefoxDriver功能 [{raisesAccessibilityExceptions = false,language = Ruby, browserstack.selenium.jar.version = 3.0.1,appBuildId = 20161104212021, MOZ:firefoxOptions = {ARGS = [], 轮廓= UEsDBBQACAgIANyqjUkAAAAAAAAAAAAAAAAHAAAAdXNlci5qc51XS2 / BOBC + 769Y + LQFaiJp2svuYZFNU2CBYlPUCHokKHJkMaZILh + W / e87pKT6pUecUyJ5RpzH930zjB4ctQ7KPxYaQmPchlhndnviDd946qA2AajQfvH + 9 + AivPvrt3hwKZxp8Il4VkL + X + o1qZlqmAMCmhUKBDqWTPkzT8EC2ljjQnKpgKlQtc8EjbaSz / j3wVYhWGIr6av9Mv1smfdLBXodKnT88OnTcMAOmMA / AgLwAOKLdD7cYyxcwWCiwtSY147yypkaqOdO2kBd1DTIOrnc3QwfxBmvgAjpN10 + W + n05oEVnmD19JN + UMbPWAvTaGWYwNA0W6c + VKb5UYFeYXFTYYfdscG1DT4dRmsjmJppFWyDMcoTcM44brQ36rg7l9Xycq2NxiLXUBfgVvnRT + fiwXuJVsEgdBz4iGUuMVDKHfPVtK + SekOMBU1hF8BpplLvrwZcmVDwPerhwxoohJNbfGacA3Y / aszcI3ooBxdG0jvBKb5fZkDMtFV6q9gexOPtzeo / g6hMDh + HjfGVeNI / pEYw + NsbIjEq8 / z9K3osWGFi + LNQTG / + XlwCuk2fMqXoi8fSpaykGaH6zkpsDtqSppIBlPQBP / B / lG4MNwk0GxlIV4Ieo5hdx4NxPVEM24jsmgamTyiPllRISYvfpg0onugZXQLA4izlhA2dMUaiRTgA0Vjbcv + MJiMHAI9Ohn1mJN1KaBA7tJY7EJlq1Gg + 0ssJuEWbOPs4mVl / cCkV4H / EByd5oMbJtdTUGiX5fhpEGhrkN + lKcYSEcyCcBNp + maSXq1jUMnPyW355n1H / Oj0f / Mxkxr9koOtp6idajqjqgfCYZpOxf8l4U5ZoB0tmrScIXOxXsacCShZVGNatvuzc20m5PgUGaERrQkYDbDPscIm9SWT31EGeoYYGtyetZmf7D3O206QZDj2 / hjlU 9 / V / fP56T + 4IO0DispgvbMvaOTk5K84b35N5GrWXSTt4yaN88pCWFOnz1xRJAdu + vkZHrWYxmM + t3K04wjUp6 + 3N2FhpI6KaBXyksMXezMzMo23hCckwG0 + hcKnLyv3m7K8WyrmpzxyvOk7MLTs1aalORKztJKiQ8q / i2QmeDTbBSTE8mS4U + VyK74bnfjv1lr0WIcpDnOlqZzuis90iOr + BHu0rPm9Th30F9TjmmTdZuYTe4SCOqG3alSGT4l / 90C6Hg18 + 2YQwhSVukhopm9yXFtwyrWE5qnOKnO7SuFOaXyL3Bo0br2u3mdA8WETMPmlUXz0DXiujvgLcpzApvvncjqV / 21 + u33cIE0KmWrKZeT94ZXvrVU2Z9Tq97C4FkxP + SIdyxg840FDqCqlSEbVcV0GN7DSnpfZpowgU19GJfh6d1gf5lilEe1EgNd5MMikX6TaDx05htKPwJEgPC3W6LqEs4KVnZqM + qKYqfbTtNnnYdX8CUEsHCF8gITk6BAAAzA8AAFBLAQIUABQACAgIANyqjUlfICE5OgQAAMwPAAAHAAAAAAAAAAAAAAAAAAAAAAB1c2VyLmpzUEsFBgAAAAABAAEANQAAAG8EAAAAAA ==}, 分辨率= 1024x768,platform = XP,specificationLevel = 0, acceptSslCerts = false,processId = 4596,browser = firefox, browserVersion = 50.0,platformVersion = 6.1,acceptSslCert = false, XULappId = {ec8030f7-c20a-464f-9b0e-13a3a9e97384},browserName = firefox, takesScreenshot = true,browser_version = 50.0,platformName = windows_nt, 64bit = true,browserstack.debug = true,rotate = false,os = Windows, browserstack.ie.noFlash = false,os_version = 7,firefoxOptions = {args = [], 轮廓= UEsDBBQACAgIANyqjUkAAAAAAAAAAAAAAAAHAAAAdXNlci5qc51XS2 / BOBC + 769Y + LQFaiJp2svuYZFNU2CBYlPUCHokKHJkMaZILh + W / e87pKT6pUecUyJ5RpzH930zjB4ctQ7KPxYaQmPchlhndnviDd946qA2AajQfvH + 9 + AivPvrt3hwKZxp8Il4VkL + X + o1qZlqmAMCmhUKBDqWTPkzT8EC2ljjQnKpgKlQtc8EjbaSz / j3wVYhWGIr6av9Mv1smfdLBXodKnT88OnTcMAOmMA / AgLwAOKLdD7cYyxcwWCiwtSY147yypkaqOdO2kBd1DTIOrnc3QwfxBmvgAjpN10 + W + n05oEVnmD19JN + UMbPWAvTaGWYwNA0W6c + VKb5UYFeYXFTYYfdscG1DT4dRmsjmJppFWyDMcoTcM44brQ36rg7l9Xycq2NxiLXUBfgVvnRT + fiwXuJVsEgdBz4iGUuMVDKHfPVtK + SekOMBU1hF8BpplLvrwZcmVDwPerhwxoohJNbfGacA3Y / aszcI3ooBxdG0jvBKb5fZkDMtFV6q9gexOPtzeo / g6hMDh + HjfGVeNI / pEYw + NsbIjEq8 / z9K3osWGFi + LNQTG / + XlwCuk2fMqXoi8fSpaykGaH6zkpsDtqSppIBlPQBP / B / lG4MNwk0GxlIV4Ieo5hdx4NxPVEM24jsmgamTyiPllRISYvfpg0onugZXQLA4izlhA2dMUaiRTgA0Vjbcv + MJiMHAI9Ohn1mJN1KaBA7tJY7EJlq1Gg + 0ssJuEWbOPs4mVl / cCkV4H / EByd5oMbJtdTUGiX5fhpEGhrkN + lKcYSEcyCcBNp + maSXq1jUMnPyW355n1H / Oj0f / Mxkxr9koOtp6idajqjqgfCYZpOxf8l4U5ZoB0tmrScIXOxXsacCShZVGNatvuzc20m5PgUGaERrQkYDbDPscIm9SWT31EGeoYYGtyetZmf7D3O206QZDj2 / hjlU 9 / V / fP56T + 4IO0DispgvbMvaOTk5K84b35N5GrWXSTt4yaN88pCWFOnz1xRJAdu + vkZHrWYxmM + t3K04wjUp6 + 3N2FhpI6KaBXyksMXezMzMo23hCckwG0 + hcKnLyv3m7K8WyrmpzxyvOk7MLTs1aalORKztJKiQ8q / i2QmeDTbBSTE8mS4U + VyK74bnfjv1lr0WIcpDnOlqZzuis90iOr + BHu0rPm9Th30F9TjmmTdZuYTe4SCOqG3alSGT4l / 90C6Hg18 + 2YQwhSVukhopm9yXFtwyrWE5qnOKnO7SuFOaXyL3Bo0br2u3mdA8WETMPmlUXz0DXiujvgLcpzApvvncjqV / 21 + u33cIE0KmWrKZeT94ZXvrVU2Z9Tq97C4FkxP + SIdyxg840FDqCqlSEbVcV0GN7DSnpfZpowgU19GJfh6d1gf5lilEe1EgNd5MMikX6TaDx05htKPwJEgPC3W6LqEs4KVnZqM + qKYqfbTtNnnYdX8CUEsHCF8gITk6BAAAzA8AAFBLAQIUABQACAgIANyqjUlfICE5OgQAAMwPAAAHAAAAAAAAAAAAAAAAAAAAAAB1c2VyLmpzUEsFBgAAAAABAAEANQAAAG8EAAAAAA ==}, version = 50.0,proxy = {},command_id = 1,firefox_binary = c:\ Program Files (x86)\ firefox 50.0 \ firefox.exe,browserstack.video = true,orig_os = win7, takesElementScreenshot = TRUE, firefox_profile = UEsDBBQAAAAIADNwWUmK7I + M9AMAA ...,proxy_type = node}] 会议ID:0c6443f1-43a1-4441-b022-05be88e202ed
调查结果:
仅在Firefox v50
上发生。在本地以及BrowserStack
等云基础架构上进行测试。
这是Firefox v50上的已知问题吗?有人可以帮忙吗?
答案 0 :(得分:0)
看起来这是一个已知问题。
https://github.com/seleniumhq/selenium-google-code-issue-archive/issues/7931
该线程中发布的解决方法是在呼叫周围放置$url = "http://www.mapquestapi.com/traffic/v2/flow?key=**REMOVED**&mapLat=34.05396382838673&mapLng=-118.24529104634557&mapHeight=1000&mapWidth=1000&mapScale=433342";
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_HEADER, 0);
curl_setopt($curl, CURLOPT_TIMEOUT, 300);
curl_setopt($curl, CURLOPT_USERAGENT, 'Mozilla/5.0 (compatible; MSIE 8.0; Trident/4.0)');
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$imgData = curl_exec($curl);
$http_status = curl_getinfo($curl, CURLINFO_HTTP_CODE); // You may not need this
curl_close($curl);
。这个电话似乎有效,但由于某些原因它不必要地抛出。我自己没有使用过这个,但是线程中至少有一个其他用户声称它适用于他们。
答案 1 :(得分:0)
使用Firefox 47,我试图调查此问题并询问/提高票据应该在哪里。 47以上的所有firefox都有这个问题,在2.4-3.4之间的所有硒,gecko驱动程序1.4-1.6.1。
答案 2 :(得分:0)
使用execute_script
时,我已经体验过版本3以上的所有Geckodriver和selenium-webdriver。
我切换回selenium-webdriver-2.53.4并使用firefox驱动程序。然后问题就出来了。