Ask a Question

Batch script not running through TestComplete

SOLVED
nsievert
Contributor

Batch script not running through TestComplete

I want to run a batch script in one of my tests that deletes some records from a db. 

I have the following function: 

function deleteReports() {
Sys.OleObject("WScript.Shell").Exec("cmd /c C:\Users\nnr6cbq\Desktop\Delete_Dashboard_Reports.bat");
}

When I execute the function, it seems to very quickly open a cmd prompt but then stops and the test shows as passed.

However, the script was not actually executed. 

 

When I run the script manually, it works as intended. What am I missing? 

1 ACCEPTED SOLUTION

Accepted Solutions
nsievert
Contributor

Re: Batch script not running through TestComplete

Thanks, adding the batch script as a TestedApp and running like TestedApps.*Name*.Run(); worked

 

 

View solution in original post

2 REPLIES 2
Marsha_R
Community Hero

Re: Batch script not running through TestComplete

This archived thread may be of some help

https://community.smartbear.com/t5/TestComplete-General-Discussions/How-do-i-run-a-Batch-file-from-t...

Marsha_R
[Community Hero]
____
[Community Heroes] 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 Heroes]
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 Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
nsievert
Contributor

Re: Batch script not running through TestComplete

Thanks, adding the batch script as a TestedApp and running like TestedApps.*Name*.Run(); worked

 

 

View solution in original post

cancel
Showing results for 
Search instead for 
Did you mean: