package javaapplication3;
import java.lang.*;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.WebDriver;
/**
*
* @author kipl74
*/
public class JavaApplication3 {
/**
* @param args the command line arguments
*/
static WebDriver driver = new FirefoxDriver();
public static void main(String[] args) {
// TODO code application logic here
String baseurl="www.google.com";
driver.get(baseurl);
}
}
当我运行这段代码时,我得到了以下错误。如何解决?
Exception in thread "main" org.openqa.selenium.WebDriverException: f.QueryInterface is not a function
Command duration or timeout: 16 milliseconds
Build info: version: '2.39.0', revision: 'ff23eac', time: '2013-12-16 16:12:12'
System info: host: 'comp74', ip: '192.168.0.74', os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.7.0_17'
Session ID: 0282db64-b28b-4c3b-ba83-26fe06bd46a3
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Capabilities [{platform=XP, acceptSslCerts=true, javascriptEnabled=true, cssSelectorsEnabled=true, databaseEnabled=true, browserName=firefox, handlesAlerts=true, browserConnectionEnabled=true, webStorageEnabled=true, nativeEvents=true, rotatable=false, locationContextEnabled=true, applicationCacheEnabled=true, takesScreenshot=true, version=26.0}]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:193)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:145)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:554)
at org.openqa.selenium.remote.RemoteWebDriver.get(RemoteWebDriver.java:276)
at javaapplication3.JavaApplication3.main(JavaApplication3.java:23)
Caused by: org.openqa.selenium.remote.ErrorHandler$UnknownServerException: f.QueryInterface is not a function
Build info: version: '2.39.0', revision: 'ff23eac', time: '2013-12-16 16:12:12'
System info: host: 'comp74', ip: '192.168.0.74', os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.7.0_17'
Driver info: driver.version: unknown
at <anonymous class>.FirefoxDriver.prototype.get(file:///C:/Users/kipl74/AppData/Local/Temp/anonymous2500892407184382634webdriver-profile/extensions/fxdriver@googlecode.com/components/driver_component.js:8720)
at <anonymous class>.DelayedCommand.prototype.executeInternal_/h(file:///C:/Users/kipl74/AppData/Local/Temp/anonymous2500892407184382634webdriver-profile/extensions/fxdriver@googlecode.com/components/command_processor.js:10831)
at <anonymous class>.DelayedCommand.prototype.executeInternal_(file:///C:/Users/kipl74/AppData/Local/Temp/anonymous2500892407184382634webdriver-profile/extensions/fxdriver@googlecode.com/components/command_processor.js:10836)
at <anonymous class>.DelayedCommand.prototype.execute/<(file:///C:/Users/kipl74/AppData/Local/Temp/anonymous2500892407184382634webdriver-profile/extensions/fxdriver@googlecode.com/components/command_processor.js:10778)
Java Result: 1
请检查您的调用方法以打开浏览器。我相信您已经编写了这样的代码:
driver.get("Url"); //Incorrect Code
正确的应该是这样:
driver.get(Url);// Correct Code
方法get
需要协议作为URL的一部分。
更改:
String baseurl = "www.google.com";
致:
String baseurl = "http://www.google.com";
java.lang.IllegalAccessError:试图从类org.openqa.selenium.os.executableFinder访问类org.openqa.selenium.firefox.firefoxBinary
JAVAClassCastException:weblogic。xml。jaxp。无法将RegistryXMLReader强制转换为组织。xml。萨克斯。XMLReaderWarning:尝试使用SAX加载SAX XMLReader时捕获到异常警告:异常为:java。ClassCastException:weblogic。xml。jaxp。无法将RegistryXMLReader强制转换为组织。x
./src/App。less(./node_modules/css loader/dist/cjs.js??ref--5-oneOf-8-1!。/node_modules/postss loader/src??postss!。/node_modules/resolve url loader??ref--5-oneOf-8-4!。/src/App less)类型错误:此。getOptions不是一个
连接到:Oracle Database 11g Enterprise Edition版本11.2.0.1.0-64bit产品,具有分区、OLAP、数据挖掘和实际应用程序测试选项
C:\用户\华硕 3m增加了4个包,更改了713个包,审计了718个包 17个包正在寻找资金运行了解详细信息 发现0个漏洞
运行以下代码: 给出以下错误: