Selenium web driver fails after the first test run and TestFixtureTearDown happens

Detection score: 3.5

<p>I have the similar issue.
I have a test using selenium C# webdriver  chorme on windows 10.
When i am running this test one at a time it is working fine.
I am using the same test for loadtest in visual studio 2017.
There I am am trying to run multiple instance of the same test.
The first instance is always getting executed perfectly , but all the rest are not recognizing the web element and throwing the error mentioned below.</p>

<p>Could you please help me.
Thanks in advance.</p>

<p>Test method LoadWebTestPOC.WebTestM.LoginWithCredentials threw exception: 
OpenQA.Selenium.WebDriverException: <strong>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:54049</strong>
   at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
   at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket&amp; socket, IPAddress&amp; address, ConnectSocketState state, IAsyncResult asyncResult, Exception&amp; exception)
   --- End of inner exception stack trace ---
   at System.Net.HttpWebRequest.GetRequestStream(TransportContext&amp; context)
   at System.Net.HttpWebRequest.GetRequestStream()
   at OpenQA.Selenium.Remote.HttpCommandExecutor.MakeHttpRequest(HttpRequestInfo requestInfo)
   at OpenQA.Selenium.Remote.HttpCommandExecutor.Execute(Command commandToExecute)
   at OpenQA.Selenium.Remote.DriverServiceCommandExecutor.Execute(Command commandToExecute)
   at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)</p>

<p>OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
OpenQA.Selenium.Remote.RemoteWebDriver.FindElement(String mechanism, String value)
OpenQA.Selenium.Remote.RemoteWebDriver.FindElementByCssSelector(String cssSelector)
OpenQA.Selenium.By.&lt;>c__DisplayClass23_0.b__0(ISearchContext context)
OpenQA.Selenium.By.FindElement(ISearchContext context)
OpenQA.Selenium.Remote.RemoteWebDriver.FindElement(By by)
M.PerformanceTest.Library.CoreOperation.EnterText(By textField, String textToEnter) in C:\M.PerformanceTest\M.PerformanceTest\Library\CoreOperation.cs: line 39
M.PerformanceTest.Modules.LoginModule.LoginWithCredentials(String user, String password) in C:\M.PerformanceTest\M.PerformanceTest\Modules\LoginModule.cs: line 37
LoadWebTestPOC.WebTestM.LoginWithCredentials() in C:\M.PerformanceTest\M.PerformanceTest\WebTests\WebTestM.cs: line 39</p>
Posted 9 days ago | reported 9 days ago
Posted by ikhlaque mohammad (1)

Caught by 3 reasons: