Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/329.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
Selenium测试返回与chrome和egde相同的错误java.net.SocketException_Java_Selenium - Fatal编程技术网

Selenium测试返回与chrome和egde相同的错误java.net.SocketException

Selenium测试返回与chrome和egde相同的错误java.net.SocketException,java,selenium,Java,Selenium,我有一个非常基本的硒测试。 我试过用chrome,然后用edge。 测试运行,但在结束时出现错误,测试从未自行停止。 我有相同版本的chromedriver和chromimum以及chrome。 我有相同的版本边缘驱动程序和边缘。 我正在为selenium使用这个版本:selenium-java-4.0.0-alpha-6 代码如下: 公共类Test2{ 公共静态void main(字符串[]args)抛出InterruptedException{ System.setProperty(“web

我有一个非常基本的硒测试。 我试过用chrome,然后用edge。 测试运行,但在结束时出现错误,测试从未自行停止。 我有相同版本的chromedriver和chromimum以及chrome。 我有相同的版本边缘驱动程序和边缘。 我正在为selenium使用这个版本:selenium-java-4.0.0-alpha-6 代码如下:

公共类Test2{
公共静态void main(字符串[]args)抛出InterruptedException{
System.setProperty(“webdriver.edge.driver”,“C:\\selenium\\edge\\msedgedriver.exe”);
WebDriver=新的EdgeDriver();
//推出网站
驱动程序。导航()。到(“http://www.google.com/");         
《睡眠》(2000年);
driver.close();
}   
}
以下是错误跟踪:

Starting MSEdgeDriver 87.0.664.47 (ba159091e772c52e16e8d82850f3c8b934507b5d) on port 2793 Only local connections are allowed. Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping MSEdgeDriver safe. MSEdgeDriver was started successfully. Nov. 25, 2020 12:06:43 P.M. org.openqa.selenium.remote.ProtocolHandshake createSession INFO: Detected dialect: W3C 13486 [AsyncHttpClient-3-3] WARN org.asynchttpclient.netty.handler.WebSocketHandler - onError java.net.SocketException: Connection reset at java.base/sun.nio.ch.SocketChannelImpl.throwConnectionReset(SocketChannelImpl.java:345) at java.base/sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:376) at io.netty.buffer.PooledByteBuf.setBytes(PooledByteBuf.java:253) at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1133) at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:350) at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:148) at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:714) at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:650) at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:576) at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493) at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989) at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) at java.base/java.lang.Thread.run(Thread.java:830) Nov. 25, 2020 12:06:51 P.M. org.openqa.selenium.remote.http.WebSocket$Listener onError WARNING: Connection reset java.net.SocketException: Connection reset at java.base/sun.nio.ch.SocketChannelImpl.throwConnectionReset(SocketChannelImpl.java:345) at java.base/sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:376) at io.netty.buffer.PooledByteBuf.setBytes(PooledByteBuf.java:253) at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1133) at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:350) at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:148) at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:714) at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:650) at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:576) at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493) at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989) at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) at java.base/java.lang.Thread.run(Thread.java:830) 启动MSEdgeDriver 87.0.664.47(ba159091e772c52e16e8d82850f3c8b934507b5d) 在端口2793上,仅允许本地连接。 请看https://chromedriver.chromium.org/security-considerations 获取有关确保驾驶员安全的建议。 MSEdgeDriver已成功启动。2020年11月25日12:06:43下午。 org.openqa.selenium.remote.ProtocolHandshake createSession信息:检测到的方言:W3C 13486 [AsyncHttpClient-3-3]WARN org.AsyncHttpClient.netty.handler.WebSocketHandler-onError java.net.SocketException:连接重置 位于java.base/sun.nio.ch.SocketChannelImpl.throwConnectionReset(SocketChannelImpl.java:345) 位于java.base/sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:376) 在io.netty.buffer.PooledByteBuf.setBytes(PooledByteBuf.java:253) 位于io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1133) 位于io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:350) 位于io.netty.channel.nio.AbstractNioByteChannel$niobyteensafe.read(AbstractNioByteChannel.java:148) 位于io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:714) 在io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:650)上 位于io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:576) 位于io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493) 位于io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989) 位于io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) 在io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) 2020年11月25日,在java.base/java.lang.Thread.run(Thread.java:830)上 下午12:06:51 org.openqa.selenium.remote.http.WebSocket$Listener OneError警告:连接重置java.net.SocketException:连接重置 位于java.base/sun.nio.ch.SocketChannelImpl.throwConnectionReset(SocketChannelImpl.java:345) 位于java.base/sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:376) 在io.netty.buffer.PooledByteBuf.setBytes(PooledByteBuf.java:253) 位于io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1133) 位于io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:350) 位于io.netty.channel.nio.AbstractNioByteChannel$niobyteensafe.read(AbstractNioByteChannel.java:148) 位于io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:714) 在io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:650)上 位于io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:576) 位于io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493) 位于io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989) 位于io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) 在io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) 位于java.base/java.lang.Thread.run(Thread.java:830) 它起作用了。 我的图书馆并不正确。 我下载了正确的库 最新工作版本:selenium-java-3.141.59。 我的图书馆并不正确。 我下载了正确的库 最新工作版本:selenium-java-3.141.59