Selenium – A exception with a null response was thrown sending an HTTP request

本文探讨了使用TeamCity代理运行自动化测试时遇到的问题及解决尝试。错误表现为发送HTTP请求到远程WebDriver服务器时出现异常,导致测试失败。文章详细记录了排查过程,包括检查TeamCity服务状态、IE配置验证、利用Fiddler进行网络调用检查等。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

[Problem]
We use teamcity agent to run automation(mstest, selenium). It always fail with below error message. But when I run automation in this agent machine loacally, it works very well.Test method EFSchools.EnglishFirst.Odin.UITest.Features.AdvancedSearch.AdvancedSearchFeature.UserCanSearchContactByAdvancedSearch threw exception:
OpenQA.Selenium.WebDriverException: A exception with a null response was thrown sending an HTTP request to the remote WebDriver server for URL Selenium   A exception with a null response was thrown sending an HTTP requesthttp://localhost:21516/session/46ed7be5-0e83-45e7-9b91-1dd961847f06/element/d1808de8-640e-4316-8f0b-3ee2b47d7c52/value. The status of the exception was ReceiveFailure, and the message was: The underlying connection was closed: An unexpected error occurred on a receive. —> System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a receive. —> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. —> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host

[Things I tried]

1. check wether teamcity agent service is started.
2. IE configuration is correct.
– security consistant in each level
– clear history when close browser
3. User fiddler to check every call ,since we can’t view the running display via teamcity
4. IE 11 is not supported with current web driver
5. narrow down the issue wether it’s repro on other browser(e.g: chrom or firefox)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值