1

我正在尝试使用 Jasmine maven 插件为 Microsoft Edge 浏览器运行 selenium web 测试。所有必需的 jars(Selenium 边缘驱动程序)和用于 Edge 的 microsoftWebDriver 都已就位。但是,我在运行测试时遇到了一些超时。下面是堆栈跟踪。

[DEBUG] Exception while filling
    java.io.IOException: An existing connection was forcibly closed by the remote host
        at sun.nio.ch.SocketDispatcher.read0(Native Method)
        at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:43)
        at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)
        at sun.nio.ch.IOUtil.read(IOUtil.java:197)
        at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:379)
        at org.eclipse.jetty.io.nio.ChannelEndPoint.fill(ChannelEndPoint.java:235)
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint.fill(SelectChannelEndPoint.java:365)
        at org.eclipse.jetty.http.HttpParser.fill(HttpParser.java:1044)
        at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:280)
        at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
        at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:667)
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
        at java.lang.Thread.run(Thread.java:745)

[ERROR] Failed to execute goal com.github.searls:jasmine-maven-plugin:2.0:test (EdgeTest) on project Jasminetest: The jasmine-maven-plugin encountered an exception:
    [ERROR] java.lang.RuntimeException: org.openqa.selenium.TimeoutException: Timed out after 300 seconds waiting for com.github.searls.jasmine.runner.SpecRunnerExecutor$1@5c7697b7
    [ERROR] Build info: version: '2.48.2', revision: '41bccdd10cf2c0560f637404c2d96164b67d9d67', time: '2015-10-09 13:08:06'
    [ERROR] System info: host: 'jenkins-w10-001', ip: '172.20.0.221', os.name: 'Windows 8.1', os.arch: 'amd64', os.version: '6.3', java.version: '1.7.0_79'
    [ERROR] Session ID: 2D9AB25F-E3BA-4605-AF30-7AAB5BE723F2
    [ERROR] Driver info: org.openqa.selenium.edge.EdgeDriver
    [ERROR] Capabilities [{platformVersion=10, platform=ANY, acceptSslCerts=true, browserVersion=20.10240.16384.0, platformName=windows, browserName=MicrosoftEdge, takesElementScreenshot=true, takesScreenshot=true, pageLoadStrategy=normal}]
    [ERROR] at com.github.searls.jasmine.runner.SpecRunnerExecutor.execute(SpecRunnerExecutor.java:53)
    [ERROR] at com.github.searls.jasmine.mojo.TestMojo.executeSpecs(TestMojo.java:236)
    [ERROR] at com.github.searls.jasmine.mojo.TestMojo.run(TestMojo.java:204)
    [ERROR] at com.github.searls.jasmine.mojo.AbstractJasmineMojo.execute(AbstractJasmineMojo.java:385)
    [ERROR] at com.github.searls.jasmine.mojo.TestMojo.execute(TestMojo.java:191)
    [ERROR] at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
    [ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
    [ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    [ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    [ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
    [ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
    [ERROR] at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
    [ERROR] at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
    [ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
    [ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
    [ERROR] at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
    [ERROR] at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862)
    [ERROR] at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
    [ERROR] at org.apache.maven.cli.MavenCli.main(MavenCli.java:197)
    [ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    [ERROR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    [ERROR] at java.lang.reflect.Method.invoke(Method.java:606)
    [ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
    [ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    [ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    [ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)

运行测试时,边缘浏览器成功启动,会话启动。但是,在多次请求之后,会抛出超时异常。所以,我猜 webdriver 服务器没有按预期响应。下面是服务器启动的跟踪。

[INFO] --- jasmine-maven-plugin:2.0:test (EdgeTest) @ Jasminetest ---
[INFO] jetty-8.1.14.v20131031
[INFO] Started SelectChannelConnector@0.0.0.0:50015
[INFO] Executing Jasmine Specs
[INFO] Skipping spec runner generation, because an identical spec runner already exists.
Starting server...
Fully qualified URI to listen on: http://localhost:10380/
Waiting for new request...

Received a request for http://localhost:10380/status
Waiting for new request...

Received a request for http://localhost:10380/session
Waiting for new request...

Received a request for http://localhost:10380/session/2FE94877-4768-4DA5-B619-BB57B6DD66F9/url
Waiting for new request...

Selenium 边缘驱动程序及其依赖项是最新的。任何解决此问题的帮助表示赞赏。提前谢谢。

4

0 回答 0