有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java如何设置可执行IE 11驱动程序的路径

我对Selenium是新手,我正在尝试将HP ALM与Selenium集成。我正在尝试在IE 11中启动HP ALM。我没有得到正确的IE11网络驱动程序。 以下是错误:

FAILED CONFIGURATION: @BeforeClass Init java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.ie.driver system property; for more information, see https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver. The latest version can be downloaded from http://selenium-release.storage.googleapis.com/index.html at com.google.common.base.Preconditions.checkState(Preconditions.java:197) at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:109) at org.openqa.selenium.ie.InternetExplorerDriverService.access$0(InternetExplorerDriverService.java:1) at org.openqa.selenium.ie.InternetExplorerDriverService$Builder.findDefaultExecutable(InternetExplorerDriverService.java:167) at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:296) at org.openqa.selenium.ie.InternetExplorerDriver.setupService(InternetExplorerDriver.java:251) at org.openqa.selenium.ie.InternetExplorerDriver.(InternetExplorerDriver.java:172) at org.openqa.selenium.ie.InternetExplorerDriver.(InternetExplorerDriver.java:146) at database.Test1.Init(Test1.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.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85) at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:510) at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:211) at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:138) at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:170) at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:104) at org.testng.TestRunner.privateRun(TestRunner.java:773) at org.testng.TestRunner.run(TestRunner.java:623) at org.testng.SuiteRunner.runTest(SuiteRunner.java:357) at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:352) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:310) at org.testng.SuiteRunner.run(SuiteRunner.java:259) at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86) at org.testng.TestNG.runSuitesSequentially(TestNG.java:1185) at org.testng.TestNG.runSuitesLocally(TestNG.java:1110) at org.testng.TestNG.run(TestNG.java:1018) at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:111) at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:204) at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:175)

浏览到webforums后,请输入错误信息。我得到了上面的错误。专家们能帮我解决这个问题吗。此外,我还需要使用Selenium在QC中运行测试集的指南


共 (1) 个答案

  1. # 1 楼答案

    错误消息(几乎)准确地告诉您要做什么:

    The path to the driver executable must be set by the webdriver.ie.driver system property; for more information, see https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver. The latest version can be downloaded from http://selenium-release.storage.googleapis.com/index.html

    http://selenium-release.storage.googleapis.com/index.html?path=2.49/下载最新的IE驱动程序服务器(64位或32位-这很重要),按照说明运行,然后只需执行以下操作:

    System.setProperty("webdriver.ie.driver", "<your download location>");
    

    @BeforeClass中创建WebDriver引用之前