Test automation on Virtual Machines
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Test automation on Virtual Machines
Hi,
I'm looking for any alternative methods to perform our nightly automation testing.
Our current train looks like this:
1. Tests developed on my local PC are pushed to an Azure Repository.
2. In DevOps we have a Pipeline task 'TestExecute test adapter installer' that triggers the test suite to run overnight.
3. Our target TestMachine is a VM with TestExecute deployed and an Agent listening for work from the DevOps pipeline.
4. We RDP to the TestMachine and can watch the tests executing. So far, so good.
5. The problem occurs when the Machine used to RDP to the TestMachine invokes its screen saver or powers down causing the tests to fail. Our current RDP machine had the Power & Sleep settings set to 'Never' but it was still going into sleep mode. (I'm currently trialling a work around that involves an easy fix to a registry value to expose the 'System Unattended Sleep Timeout'; that was set to 15 minutes; in Advanced Power Options https://windowsreport.com/windows-10-goes-to-sleep-after-2-minutes/ ).
If the work around fails, and I have to eliminate using RDP, what are my other alternatives(if any) to run automation on the VM. Relocating TestExecute onto a physical machine is not an option.
Also, if anyone has had a successful outcome using SessionCreator on remote virtual machines, I would dearly like to hear from them.
Thanks
Mark
Solved! Go to Solution.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Have you checked through all of these references?
https://support.smartbear.com/testcomplete/docs/testing-with/running/via-rdp/overview.html
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We had exactly the same issue last night when an IT upgrade disconnected the RDP machine. All the tests failed due to no UI.
The reference doesn't advise on how to keep tests running when the RDP session disconnects.
We're trying to integrate TestExecute with our Devops pipeline as well so are keen to see the solution.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@jr348 There is this section about disconnecting in that same reference
-
If you need to disconnect from the Remote Desktop session, you can retarget the session to the remote computer’s console before starting your tests. For detailed information, see Disconnecting From Remote Desktop While Running Automated Tests.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for your reply Marsha,
We've tried several options, and can successfully run our Devops pipeline on the remote VM providing a RDP session initiated from a machine that has its Power and Screen saver options turned off.
We will try the method using tscon documented in Disconnecting From Remote Desktop While Running Automated Tests. If we have success running the tscon command manually, we'll then try inserting it into the pipeline.
Thanks
Mark
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
> If we have success running the tscon command manually
Just a note that tscon must be executed with elevated admin credentials.
/Alex [Community Champion]
____
[Community Champions] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Champions]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Champion] signature is assigned on quarterly basis and is used with permission by SmartBear Software.
https://community.smartbear.com/t5/Community-Champions/About-the-Community-Champions-Program/gpm-p/252662
================================
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Everyone,
Alex, you've stolen my thunder 🙂 I was just about to report our success with tscon. We ran the command manually on the RDP machine which 'shut' it down while the Agent was 'listening' for work. Our next step will be to create the batch file to run the tscon command and include it in the nightly pipeline.
So, to run this command (as Alex says, run as an administrator ) within the RDP window, from the Command Line.
>query user (this will return the sessionname eg rdp-tcp#xx)
>tscon.exe rdp-tcp#xx /dest:console
respond "yes" to to close your session
...all done
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
> Alex, you've stolen my thunder
Yes, I am that kind of a guy 😉
I did not verified it from Jenkins but I believe that it should work (and it worked for me in different scenarios) - you may consider to execute this batch file using PowerShell with the '-verb RunAs' to elevate file's privileges (https://ss64.com/ps/syntax-elevate.html)
/Alex [Community Champion]
____
[Community Champions] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Champions]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Champion] signature is assigned on quarterly basis and is used with permission by SmartBear Software.
https://community.smartbear.com/t5/Community-Champions/About-the-Community-Champions-Program/gpm-p/252662
================================
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks everyone that has solved our problem as well and will allow us to start integrating into our pipline.
@mbeckham Your question and description of your pipline integration was really good and the exactly where we want to go and the additional PS will be a help in our repeating the same.
