c# - 无法通过 Jenkins 执行 NUnit Selenium 测试 - 目标机器主动拒绝连接
问题描述
我正在尝试通过 Jenkins 使用 NUnit 执行用 C#.NET 编写的 Selenium 测试,但显示以下错误消息:
-> error: Unexpected error. System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:13748
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)
该解决方案似乎构建成功,但同样,在执行测试时,我收到上述错误消息。
注意:我检查了我的防火墙设置,并且允许 Jenkins 通过防火墙。
任何反馈将不胜感激。
解决方案
Selenium 在测试运行 (BeforeTestRun) 之前被实例化。这意味着在第一个测试之后执行的任何后续测试都不会引用 WebDriver 的实例,因为它没有在场景开始时重新实例化。
推荐阅读
- json - 添加重量属性时,Snipcart 中的产品抓取“购物车确认”错误
- reactjs - res.status(404)后如何将json数据从后端(express.js)发送到前端(react)?
- php - Laravel 集合中最新外键的唯一标识符
- r - 如何将一个数据帧的列中的值与R中另一个数据帧的标题匹配
- android - Media pipe Android App上的横向方向。一旦将应用程序设置为横向模式,相机方向就会出错
- java - 如何使用 AssertJ 检查对象的多个字段是否为空?
- node.js - SyntaxError: missing ) after argument list 似乎找不到可能的解决方案
- reactjs - 无法读取未定义的属性(读取“地图”) - useQuery
- mysql - 在 Power Bi 中加载比他们更多的行是
- google-sheets - ArrayFormula 什么都不做