Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/selenium/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
org.openqa.selenium.remote.SessionNotFoundException从Jenkins启动时,使用IEDriverServer 32位运行IE10时出错_Selenium_Jenkins - Fatal编程技术网

org.openqa.selenium.remote.SessionNotFoundException从Jenkins启动时,使用IEDriverServer 32位运行IE10时出错

org.openqa.selenium.remote.SessionNotFoundException从Jenkins启动时,使用IEDriverServer 32位运行IE10时出错,selenium,jenkins,Selenium,Jenkins,我正在尝试使用Jenkins在虚拟机上使用32位IEDriverServer启动IE10 当我使用IEDriverServer 32位在VM本身上运行它时,它工作正常。如果我使用IEDriverServer 64位并从Jenkins调用它,它也可以正常工作。但当我使用IEDriverServer 32位并从Jenkins启动它时,它会失败,并出现以下错误: Running tests.generated.LVATC01TG01_IE10_Test I 2013-11-01 11:03:02:77

我正在尝试使用Jenkins在虚拟机上使用32位IEDriverServer启动IE10

当我使用IEDriverServer 32位在VM本身上运行它时,它工作正常。如果我使用IEDriverServer 64位并从Jenkins调用它,它也可以正常工作。但当我使用IEDriverServer 32位并从Jenkins启动它时,它会失败,并出现以下错误:

Running tests.generated.LVATC01TG01_IE10_Test
I 2013-11-01 11:03:02:772 server.cc(53) Starting WebDriver server on port: '37042' on host: ''
D 2013-11-01 11:03:02:773 server.cc(104) Mongoose ACL is -0.0.0.0/0,+127.0.0.1
Started InternetExplorerDriver server (32-bit)
2.37.0.0
Listening on port 37042
Log level is set to DEBUG
D 2013-11-01 11:03:03:329 server.cc(239) Command: GET /status {}
D 2013-11-01 11:03:03:330 server.cc(308) Response: {"sessionId":"","status":0,"value":{"build":{"version":"2.37.0.0"},"os":{"arch":"x64","name":"windows","version":"6.1.7601"}}}

D 2013-11-01 11:03:03:513 server.cc(239) Command: POST /session {"desiredCapabilities":{"platform":"WINDOWS","ensureCleanSession":true,"browserName":"internet explorer","logLevel":"DEBUG","version":""}}
D 2013-11-01 11:03:03:514 IESession.cpp(43) Mutex acquired for session initalization
D 2013-11-01 11:03:03:520 IESession.cpp(105) Releasing session initialization mutex
D 2013-11-01 11:03:03:520 command.cc(33) Raw JSON command: { "command" : "newSession", "locator" : { }, "parameters" : {"desiredCapabilities":{"platform":"WINDOWS","ensureCleanSession":true,"browserName":"internet explorer","logLevel":"DEBUG","version":""}} }
W 2013-11-01 11:03:03:523 BrowserFactory.cpp(795) Couldn't find IE version for executable %ProgramFiles(x86)%\Internet Explorer\ielowutil.exe, falling back to -1
D 2013-11-01 11:03:03:529 BrowserFactory.cpp(66) Ignoring Protected Mode Settings: 0
D 2013-11-01 11:03:03:529 BrowserFactory.cpp(69) Checking validity of Protected Mode settings.
D 2013-11-01 11:03:03:529 BrowserFactory.cpp(846) Detected IE version: -1, detected Windows version: 6
D 2013-11-01 11:03:03:531 BrowserFactory.cpp(72) Has Valid Protected Mode Settings: 1
D 2013-11-01 11:03:03:555 BrowserFactory.cpp(168) Starting IE using the IELaunchURL API
W 2013-11-01 11:03:03:578 BrowserFactory.cpp(173) -2147024894 [The system cannot find the file specified.]: Error using IELaunchURL to start IE
W 2013-11-01 11:03:03:578 IECommandExecutor.cpp(627) Unable to launch browser, received NULL process ID
W 2013-11-01 11:03:03:578 response.cc(69) Error response has status code 6 and message 'Unexpected error launching Internet Explorer. IELaunchURL() returned 80070002 for URL 'http://localhost:37042/'' message
W 2013-11-01 11:03:03:578 IECommandExecutor.cpp(516) Unable to get current browser
D 2013-11-01 11:03:03:583 IESession.cpp(146) Executor shutdown successful!
D 2013-11-01 11:03:03:583 IESession.cpp(154) Posting thread shutdown message
D 2013-11-01 11:03:03:583 IESession.cpp(157) Starting wait for thread completion
D 2013-11-01 11:03:03:583 IESession.cpp(160) Waiting for thread to end returned 4294967295
D 2013-11-01 11:03:03:583 server.cc(308) Response: {"sessionId":"47dfd98f-f9be-4b95-810d-4428c3f98af1","status":6,"value":{"message":"Unexpected error launching Internet Explorer. IELaunchURL() returned 80070002 for URL 'http://localhost:37042/'"}}

D 2013-11-01 11:03:03:583 IECommandExecutor.cpp(435) Shutdown message received
D 2013-11-01 11:03:03:583 IECommandExecutor.cpp(131) Entering IECommandExecutor::OnDestroy
D 2013-11-01 11:03:03:583 IECommandExecutor.cpp(133) Clearing managed element cache
D 2013-11-01 11:03:03:583 IECommandExecutor.cpp(135) Closing input manager
D 2013-11-01 11:03:03:583 IECommandExecutor.cpp(137) Closing proxy manager
D 2013-11-01 11:03:03:583 IECommandExecutor.cpp(139) Closing browser factory
D 2013-11-01 11:03:03:583 IECommandExecutor.cpp(141) Posting quit message
D 2013-11-01 11:03:03:583 IECommandExecutor.cpp(143) Leaving IECommandExecutor::OnDestroy
D 2013-11-01 11:03:03:583 IECommandExecutor.cpp(437) Returned from DestroyWindow()
D 2013-11-01 11:03:03:583 IECommandExecutor.cpp(446) Exited IECommandExecutor thread message loop
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 2.275 sec <<< FAILURE! - in tests.generated.LVATC01TG01_IE10_Test
lVA(tests.generated.LVATC01TG01_IE10_Test)  Time elapsed: 2.089 sec  <<< ERROR!
org.openqa.selenium.remote.SessionNotFoundException: Unexpected error launching Internet Explorer. IELaunchURL() returned 80070002 for URL 'http://localhost:37042/' (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 1.37 seconds
Build info: version: '2.37.1', revision: 'a7c61cbd68657e133ae96672cf995890bad2ee42', time: '2013-10-21 09:08:07'
System info: host: 'win7ietest3', ip: '10.187.160.139', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_40'
Driver info: org.openqa.selenium.ie.InternetExplorerDriver
    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:526)
    at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:193)
    at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:151)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:554)
    at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:216)
    at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:201)
    at org.openqa.selenium.ie.InternetExplorerDriver.run(InternetExplorerDriver.java:224)
    at org.openqa.selenium.ie.InternetExplorerDriver.<init>(InternetExplorerDriver.java:214)
    at org.openqa.selenium.ie.InternetExplorerDriver.<init>(InternetExplorerDriver.java:184)
    at common.Common.startIE(Common.java:181)
    at common.Common.startDriver(Common.java:95)
    at tests.generated.LVATC01TG01_IE10_Test.setUp(LVATC01TG01_IE10_Test.java:25)
我到处寻找解决方案,但大多数解决方案都与在IE中正确设置受保护模式有关(我有,因为64位驱动程序版本可以工作)

我无法使用64位驱动程序版本,因为存在已知问题(即发送键速度慢)。任何帮助都将不胜感激

乔斯,我也有同样的问题

我发现根错误是IEDriver找不到Internet Explorer.exe

我试过:

  • 与运行Jenkins的用户一起登录Jenkins计算机,并从Jenkins工作区内的命令行手动执行测试。(在我的windows计算机上,转到C:\Program Files(x86)\Jenkins\workspace\MYPROJECT\,执行mvn集成测试):执行有效

  • 将策略从PersonarioWebDriversSteps更改为PerstoriesWebDriversSteps,然后在jenkins上运行:得到相同的错误

  • 还检查了IE保护模式设置。一切都好

  • 通过jenkins使用firefox运行测试:工作正常

  • 添加的功能:
    capabilities.setCapability(“ie.forceCreateProcessApi”,true)
    并在jenkins机器上添加了一个注册值:

浏览器进程ID这次启动,但整个执行挂起:

BrowserFactory.cpp(207) Starting IE using the CreateProcess API
BrowserFactory.cpp(221) IE starting command line is: 'C:\Program Files (x86)\Internet Explorer\ielowutil.exe http://localhost:9164/'.
BrowserFactory.cpp(122) IE launched successfully with process ID 5452
BrowserFactory.cpp(128) Process with ID 5452 is executing ielowutil.exe
BrowserFactory.cpp(282) Entering BrowserFactory::AttachToBrowser

你找到解决办法了吗?

这个问题有时也会发生在我身上。当它这样做时,一个名为
%SystemDrive%
的神秘目录(实际上是这个名称,没有任何环境变量的扩展)会在我的工作目录中创建。为便于将来参考,此目录包含以下文件夹和文件:

* %SystemDrive%/
  * ProgramData/
    * Microsoft/
      * Windows/
        * Caches/
          * {6AF0698E-D558-4F6E-9B3C-3716689AF493}.2.ver0x0000000000000001.db
          * {DDF571F2-BE98-426D-8288-1A9A39C3FDA2}.2.ver0x0000000000000001.db
          * cversions.2.db

删除这个
%SystemDrive%
文件夹似乎可以解决我的问题。

我们的测试执行是通过ssh从构建系统触发的

e、 g

sshAdministrator@some.host.com“导出JAVA\u HOME=\”C:/Program Files/Java/jre1.8.0_45“cd c:/testing;mvn-PrunSystemTests -Dsys.testsuite=SanitySuite.xml-DconfigFile=/ie.properties-DsuiteName=sanitytest”

所有测试都以失败告终

。。。org.openqa.selenium.remote.SessionNotFoundException:启动Internet Explorer时出现意外错误。IELaunchURL()为URL“”返回了HRESULT 80070002(“系统找不到指定的文件”。)(警告:服务器未提供任何堆栈跟踪信息)

在运行测试之前,通过设置环境变量ProgramW6432解决了该问题

e、 g

sshAdministrator@some.host.com“导出JAVA\u HOME=\”C:/Program Files/Java/jre1.8.0_45“导出程序W6432=\“C:\Program Files”cd c:/testing;mvn-PrunSystemTests-Dsys.testsuite=SanitySuite.xml -DconfigFile=/ie.properties-DsuiteName=SANITY test”


如果应用程序在60秒内没有收到下一个命令,它将关闭

[BaseDriver]正在关闭,因为我们等待了60秒的命令
[调试][AndroidDriver]关闭Android驱动程序

在我的例子中,我的自动化在一个超过60秒的循环中,应用程序完成它的任务,这有网络依赖性

您可以通过向功能中添加“newCommandTimeout”来避免这种情况,以增加超时持续时间,如下所示:
capabilities.setCapability(“newCommandTimeout”,90)//或秒数


或者您可以添加try/catch并记录更有意义的消息。

不,我还没有弄明白。你设法解决了吗?我从这篇文章()中了解到,自从IE9.0.3以来,ielowutil不再作为任务启动,但我不知道它是否与我们的问题有关。我尝试将注册表值更改为iexplore.exe,但这是不允许的。
BrowserFactory.cpp(207) Starting IE using the CreateProcess API
BrowserFactory.cpp(221) IE starting command line is: 'C:\Program Files (x86)\Internet Explorer\ielowutil.exe http://localhost:9164/'.
BrowserFactory.cpp(122) IE launched successfully with process ID 5452
BrowserFactory.cpp(128) Process with ID 5452 is executing ielowutil.exe
BrowserFactory.cpp(282) Entering BrowserFactory::AttachToBrowser
* %SystemDrive%/
  * ProgramData/
    * Microsoft/
      * Windows/
        * Caches/
          * {6AF0698E-D558-4F6E-9B3C-3716689AF493}.2.ver0x0000000000000001.db
          * {DDF571F2-BE98-426D-8288-1A9A39C3FDA2}.2.ver0x0000000000000001.db
          * cversions.2.db
package appium;

import java.net.MalformedURLException;
import java.net.URL;
import org.openqa.selenium.*;
import org.testng.*;
import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.remote.MobileBrowserType;
import io.appium.java_client.remote.MobileCapabilityType;

public class My {

    public static void main(String[] args) throws MalformedURLException {

        AndroidDriver driver;

        DesiredCapabilities capabilities = new DesiredCapabilities();
        capabilities.setCapability("deviceName", "Nexus 5");
        capabilities.setCapability("platformName", "android");
        capabilities.setCapability("platformVersion", "5.0.1");


        capabilities.setCapability("appPackage","com.android.calculator2");
        capabilities.setCapability("appActivity","com.android.calculator2.Calculator");

        driver = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"),capabilities);

        driver.quit();

    }

}