Ask a Question

Running a command line utility from inside TestComplete

SOLVED
alan-mullin
Occasional Contributor

Running a command line utility from inside TestComplete

Haven't been able to find anything close to an answer for this, so maybe I wasn't asking the search in the correct way...

 

We have a requirement to validate checksums now.

 

Is there a way to run windows certutil from inside Powershell or preferably command prompt (cmd) and pull the results into a string?

 

Running certutil and then looking for a string containing "command completed successfully" would be ideal, but I'm open to ideas.

3 REPLIES 3
tristaanogre
Esteemed Contributor

You can shell out to a command line using the WshShell object which is, essentially, just a wrapper around the Wscript.Shell object in the Microsoft Library.

 

See documentation at https://support.smartbear.com/testcomplete/docs/reference/program-objects/wshshell/index.html


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
alan-mullin
Occasional Contributor

l'll keep that in my back pocket for later, but seems a bit complicated compared to what I am tryin to do.

 

Thank you much!

Not sure it's as complicated as you think it is.  

If you're using KWT, all you need to do is use the "Call Object Method" operation, select the WshShell object as the object, Exec as the method, and, in the parameter value, just type out your command line.

 

In script, it's as described in the article.

 

If you can give a bit more detail, perhaps we can help further with implementation.


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
cancel
Showing results for 
Search instead for 
Did you mean: