org.openqa.selenium.WebDriverException: f.QueryInterface is not a function Command duration or timeout:

今天偶遇一个问题,运行项目时,发现这个问题:

org.openqa.selenium.WebDriverException: f.QueryInterface is not a function
Command duration or timeout: 30.17 seconds
Build info: version: ‘2.45.0‘, revision: ‘5017cb8e7ca8e37638dc3091b2440b90a1d8686f‘, time: ‘2015-02-27 09:10:26‘
System info: host: ‘BJWS145064‘, ip: ‘169.254.24.166‘, os.name: ‘Windows Vista‘, os.arch: ‘x86‘, os.version: ‘6.1‘, java.version: ‘1.6.0_11‘
Session ID: d5feee27-45bb-4a98-aa04-8ad84038e24b
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Capabilities [{platform=WINDOWS, acceptSslCerts=true, javascriptEnabled=true, browserName=firefox, rotatable=false, locationContextEnabled=true, version=36.0.1, cssSelectorsEnabled=true, databaseEnabled=true, handlesAlerts=true, nativeEvents=false, webStorageEnabled=true, applicationCacheEnabled=true, takesScreenshot=true}]
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.ErrorHandler.createThrowable(ErrorHandler.java:204)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:156)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:599)
at org.openqa.selenium.remote.RemoteWebDriver.get(RemoteWebDriver.java:304)
at TestModule1.Test001.test001(Test001.java:23)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: org.openqa.selenium.WebDriverException: f.QueryInterface is not a function
Build info: version: ‘2.45.0‘, revision: ‘5017cb8e7ca8e37638dc3091b2440b90a1d8686f‘, time: ‘2015-02-27 09:10:26‘
System info: host: ‘BJWS145064‘, ip: ‘169.254.24.166‘, os.name: ‘Windows Vista‘, os.arch: ‘x86‘, os.version: ‘6.1‘, java.version: ‘1.6.0_11‘
Driver info: driver.version: unknown
at <anonymous class>.FirefoxDriver.prototype.get(file:///C:/Users/145064/AppData/Local/Temp/anonymous5488289901357885105webdriver-profile/extensions/[email protected]/components/driver-component.js:10132)
at <anonymous class>.DelayedCommand.prototype.executeInternal_/h(file:///C:/Users/145064/AppData/Local/Temp/anonymous5488289901357885105webdriver-profile/extensions/[email protected]/components/command-processor.js:12274)
at <anonymous class>.fxdriver.Timer.prototype.setTimeout/<.notify(file:///C:/Users/145064/AppData/Local/Temp/anonymous5488289901357885105webdriver-profile/extensions/[email protected]/components/command-processor.js:603)

解决办法:

遇到这个问题多事url写的不正确

当给url填上https://之后就对啦。。。。

时间: 2024-10-26 10:45:18

org.openqa.selenium.WebDriverException: f.QueryInterface is not a function Command duration or timeout:的相关文章

Selenium2学习-007-WebUI自动化实战实例-005-解决 Firefox 版本不兼容:org.openqa.selenium.WebDriverException: Failed to connect to binary FirefoxBinary

此文主要讲述 Java 运行 Selenium 脚本时,因 Friefox 浏览器版本与 selenium-server-standalone-x.xx.x.jar 不兼容引起的 org.openqa.selenium.WebDriverException: Failed to connect to binary FirefoxBinary 报错解决方法. 希望能对初学 Selenium2 WebUI 自动化测试编程的亲们有所帮助.若有不足之处,敬请大神指正,不胜感激! 之前给朋友初步介绍了 S

Selenium2学习-041-chromedriver:org.openqa.selenium.WebDriverException: unknown error: cannot determine loading status from unexpected alert open

今天在写WebDriver处理弹出框(alert.confirm.prompt)演示实例脚本分发给朋友时,在其执行时未能成功执行,对应的部分错误详情如下: org.openqa.selenium.WebDriverException: unknown error: cannot determine loading status from unexpected alert open (Session info: chrome=53.0.2785.116) (Driver info: chromed

(org.openqa.selenium.WebDriverException: Unable to launch the app: Error: Trying to start logcat capture but it&#39;s already started! )错误解决办法

新增: capabilities.setCapability("autoLaunch",false); 将setup中的: driver = new AndroidDriver(new URL("http://127.0.0.1:" + port + "/wd/hub"), capabilities); driver.launchApp(); 第二句: driver.launchApp() 注释掉 (org.openqa.selenium.Web

报错org.openqa.selenium.WebDriverException: disconnected: unable to connect to renderer解决方法

做自动化时经常会遇到不兼容的问题,比如以下简单的脚本,主要是打开浏览器,然后最大化窗口,打开百度,输入内容搜索,代码如下: package com.gs.selenium; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.chrome.ChromeOption

Selenium2学习-038-firefox、webdriver版本不对称问题解决:org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055

今天有个朋友在群里问,为何脚本运行不通过,其脚本操作步骤简单描述如下: 1.启动火狐浏览器 2.打开百度 3.查询框输入关键字 4.点击按钮[百度一下] 脚本挺简单的,其给出的应用报错信息如下所示: [TestNG] Running: C:\Users\jiwei.xu\AppData\Local\Temp\testng-eclipse--429788523\testng-customsuite.xml org.openqa.selenium.firefox.NotConnectedExcept

selenium,在Eclipse中打开fireFox浏览器报错:org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms

1. 相信很多同学刚接触selenium时,在Eclipse中打开fireFox浏览器是报报错:org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:...(异常代码太多此处省略) 在网上找了好多方法都是不能解决问题,结果是焦头烂额! 2.其实这是selenium的jar包和

org.openqa.selenium.remote.SessionNotFoundException: Unexpected error launch IE

1.在启动ie浏览器前先加入属性设置一项: DesiredCapabilities ie = DesiredCapabilities.internetExplorer(); ie.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true); System.setProperty("webdriver.ie.driver", "e:/IEDriverSe

org.openqa.selenium.NoSuchElementException:

http://www.blogjava.net/qileilove/archive/2014/12/11/421309.html selenium webdriver定位不到元素的五种原因及解决办法 1.动态id定位不到元素 for example: //WebElement xiexin_element = driver.findElement(By.id("_mail_component_82_82")); WebElement xiexin_element = driver.fi

appium运行报错.&lt;init&gt;(Lorg/openqa/selenium/remote/ErrorCodes;Z)V

最近这几天就在学习appium,搭建环境就耗费了很多时间,不得不承认自己够笨的了,然后我把环境搭建好,写完脚本的时候,就报这个错了,当时是从某个群里直接下载的demo,不得不吐槽说,够坑的,是能跑通,你加了那么多jar包,这也没什么,主要是你把jar包名改了,这是我无法理解的.害得老子查这个报错,查了快一天,后来排除法才知道咋回事,报错如下: java.lang.NoSuchMethodError: org.openqa.selenium.remote.ErrorHandler.(Lorg/op