Forum Discussion

nicklott's avatar
nicklott
Occasional Contributor
7 years ago
Solved

Running TestExecute Using A PowerShell Script

I'm trying to create a PowerShell script that kicks off our automated tests in TestExecute every time there's a deploy.

 

I can run commands using the Command Line and I can launch TestExecute and run the tests from the Command Line with no problem. But when I take the same commands and try to launch TestExecute using a PowerShell script, I'm getting an error where it complains the project file being invalid. After messing around with it, I got it to launch TestExecute once, but none of the tests in the suite would run.

 

Anyone know what could be causing the PowerShell script to error when I run it?

7 Replies

    • nicklott's avatar
      nicklott
      Occasional Contributor

      Thanks for the reply; however, I don't think that that's what we're looking for.

       

      The link to that article seems to be regarding running PowerShell from TestComplete. We're actually trying to do the opposite of that, and run TestComplete/TestExecute from PowerShell.

  • cunderw's avatar
    cunderw
    Community Hero

    Can you provide examples of your powershell script and OS version? That would be very helpful.

    • nicklott's avatar
      nicklott
      Occasional Contributor

      This is the PowerShell script that I'm trying to run:

       

      Powershell
      PS C:\Users\kevin.burdett> Start-Process

      cmdlet Start-Process at command pipeline position 1
      Supply values for the following parameters:
      FilePath: PS C:\Users\kevin.burdett> Start-Process -FilePath “C:\Program Files (x86)\SmartBear\TestExecute 12\Bin\TestEx
      ecute.exe” “X:\QA\Automated Testing\Vortex\Vortex.pjs” /r /p:Vortex”C:\Program Files (x86)\SmartBear\TestExecute 12\Bin\
      TestExecute.exe” “X:\QA\Automated Testing\Vortex\Vortex.pjs” /r /p:Vortex
      Start-Process : A positional parameter cannot be found that accepts argument ‘/r’.
      At line:1 char:1
      + Start-Process -FilePath “C:\Program Files (x86)\SmartBear\TestExecute 12\Bin\Tes ...
      + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         + CategoryInfo          : InvalidArgument: (:) [Start-Process], ParameterBindingException
         + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.StartProcessCommand

       

      This doesn't work when I try to run it from PowerShell, but if I take that same file path and enter it into the Command Prompt, it will launch TestExecute and run all of the tests in our Vortex suite. I haven't been able to figure out why this works in the Command Prompt but not from a PowerShell script.

      • AlexKaras's avatar
        AlexKaras
        Champion Level 3

        Hi,

         

        > Start-Process : A positional parameter cannot be found that accepts argument ‘/r’.

        I understand the above message as that Start-Process cannot process the '/r' parameter. Actually, this parameter must be processed by TestExecute and for me this means that command line for Start-Process lacks some quotation(s).
        My guess that the command line should look like this:

        start /wait "ps "Start-Process -FilePath "“C:\Program Files (x86)\SmartBear\TestExecute 12\Bin\TestEx
        ecute.exe” “X:\QA\Automated Testing\Vortex\Vortex.pjs” /r /p:Vortex"""""

        but this is a wild guess that must be verified and corrected.