Forum Discussion

amittt72's avatar
amittt72
New Contributor
12 years ago

Test Execute not getting started through Batch File from second run onwards

Hi,

I am starting TestExecute exe and loading a project as per mentioned in the documents in Batch file.



"C:\Program File\Automated QA\Test Execute\Test Execute.exe" "C:\Amit\Amit.pjs"



My project needs to execute 10 test cases and after each test case execution, I am restarting test excute and repeating the process again.



I have included the batch file in "TestedApps" and after execution of each test case, I am running the batch file through TestedApps to restart test execute. But after successfully running for the first time, the batch file is not starting test execute in the second run.



What's the solution for this?



Thanks and Regards,

Amit Tripathi
  • aLostDawg's avatar
    aLostDawg
    Occasional Contributor

    I can't really talk to the point of using the Tested Applications to kick off a batch file.


     


    Is the batch file shutting down TestExecute, or is TestExecute shutting itself down? I'm wondering if this is the issue. What I have found when I'm using batch files to start up TestExecute is that if TestExecute is running when the batch file tries to start TestExecute it throws an error. Sometimes this error pops up on the screen and sometimes it doesn't. This could be tied into whether or not you're running it in SilentMode.


     


    Here's what I do to break up my test run.


     


    1. I use a command line argument and a command line argument parser. You can read a little more here or see the "BuiltIn.ParamCount" and "BuiltIn.ParamStr' help topics.


     


    2. I set up a batch file similar to the following:


     


    - pull date and time from system and put them into a couple of variables.


    - Call TestExecute using


        start /wait "TestExecute" "C:\Program Files[your specific location for test execute]\TestExecute.exe" [.pjs file location] /r /p:[project name] /e /SilentMode "Server=[server location]" "testcase=[TestCaseName]"


    - Copy the tcResults1.mht to another file using batch copy command and postpending the system date/time to the end so that if I run it on another server at about the same time it will have a unique name.


        Copy "C:\Users\[username]\AppData\Local\Temp\tcResults1.mht" "[new location]\[new name]"


    - Kill the IE instance that has the test results open


        taskkill /f /im iexplore.exe


     


    In the above the italics is code. Stuff in [brackets] should be replaced by your info. This should give you some more things to try.

  • aLostDawg's avatar
    aLostDawg
    Occasional Contributor
    Amit, did this solve your problem? If so, could you mark it as solved for future users? 



    If not, let me know what issues you're still having and I'll try to get you help for them too.