Selenium WebDriver tests fail with System.Net.WebException Unable to connect

限于喜欢 提交于 2019-12-05 22:08:20

The issue here was that in trying to implement some more robust error handling during startup I place a call to the Teardown code in the finally block of a try/catch wrapped around the login code, so as soon as the test harness was done logging in I was closing and cleanin up the WebDriver instance, so when the test ran there wasn't a WebDriver there to communicate with.

I suspect when I as looking at the "same" code on my dev machine the libraries that were actually running didn't have that block in them.

When you run an application from Visual Studio it fires up a server listening on a certain port. In your case 59982.

You need to actually have your web application running on its own on the test environments before running your test against it.

On your dev machine your application is running on that port. I'm guessing on your remote machines that is not the case.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!