Ask a Question

Session is disconnected message is returned after a website deployment via Octopus


Session is disconnected message is returned after a website deployment via Octopus

I deploy a website to a VM via Octopus. Once the website has been deployed I have a powershell script that iniatiates a TestExecute run. As soon as the test run is initiated the error "The operation cannot be performed, because the user session is disconnected." returned in the TestExecute log file and this happens repeatedly for each project until the end of the project suite is reached. The code to initiate the run is:


start-process -wait -filepath "C:\Program Files (x86)\SmartBear\TestExecute 12\Bin\TestExecute.exe" -argumentlist "$projectfile /run /exit /el:`"$mhtfile`" /SilentMode" 


If I am logged onto the machine via remote desktop whilst the deployment is happening the tests run without a problem. 


How can I get the tests to run without an active remote desktop connection?

Champion Level 2

You can minimize Remote Desktop


but not disconnect totally.  Remember that TestComplete is mimicking user actions so it makes sense that a user would have to be connected during the test.





Esteemed Contributor

My guess is that, during your deployment using Octopus, at some point the RDP connection is closed.  As @Marsha_R mentioned... you can't interact with a UI with the UI not available so you need some means to make sure that, after disconnecting, it is still available.


Check out the following.


Perhaps, in your Octopus deployment scripts, you can include a call to tscon to redirect the session back to console so that it remains connected after the deployment.

Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
Showing results for 
Search instead for 
Did you mean: