Forum Discussion

bgarrick's avatar
bgarrick
Occasional Visitor
5 years ago

How to validate a Windows Service is running through Test Complete

Hi there,

 

I'm new to Test Complete and scripting as a whole. I'm trying to build a test in Test Complete that can check the status of a Windows service and then display that status in the test log as well as allow me to fail the test if the status of that service is not "Running".

 

I've spent quite a few hours trying to find the answers I need with no luck. I only seem to be able to find really complex scripts that seem to have a lot of unnecessary logic and are far more advanced or they just don't seem to work at all. I've built and tweaked most of my existing tests using the record and playback functionality but I'm pretty sure this is too advanced for that. My project is built in JavaScript but I've been using the Test Complete script editor to try and get things working.

 

This PowerShell command returns the information I'm needing if I were running this test manually:

Get-Service WinRM

Example Results:

Status   Name               DisplayName
------   ----               -----------
Running  WinRM              Windows Remote Management (WS-Manag...

Does anyone have any ideas on how to approach this?

 

As much explaination as you can provide is much appreciated. It helps me to learn more about the "why" of things rather than just copying someone else's responses

 

Thanks for everyone's help in advance.

 

-BG

2 Replies