Forum Discussion

PERSIN's avatar
PERSIN
Contributor
7 years ago

Error in powershell script while trying to integrate SOAPUI tests in VSTS

I am using a script in GIT repository in VSTS(Visual Studio Team Services) to execute SOAPUI test. I am using a power shell task in the build definition. Build is getting succeeded but it is not hitting the SOAPUI part.I could see the logs as below:

 

Start-Process : A positional parameter cannot be found that accepts argument xxxxx.
At line:1 char:1
+ Start-Process -FilePath “C:\Program Files (x86)\Smartbear\SOAPUI\Bin\.. ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   + CategoryInfo          : InvalidArgument: (Smiley Happy [Start-Process], ParameterBindingException
   + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.StartProcessCommand

 

I have already tried to open the soapui path mentioned above from plain powershell and I am able to open it, but same in not working through my script. 

 

Below is my script:

 

$testrunner = '.\Program Files\SmartBear\SoapUI-5.4.0\bin\testrunner.bat'
$project = '$(System.DefaultWorkingDirectory)\SOAPUI Project\SOAPUI\xxxx.xml'
$arguments = $project, '"-sTestSuite 1"', '"-RJUnit-Style HTML Report"'

#Start-Process Powershell -FilePath $testrunner -ArgumentList '"$project"' , '"Set-ExecutionPolicy Restricted -Force"' -Verb RunAs
Start-Process "powershell" -FilePath '.\Program Files\SmartBear\SoapUI-5.4.0\bin\testrunner.bat' -Verb runAs
#start-process $(System.DefaultWorkingDirectory)\SOAPUI Project\SOAPUI\XYZ.xml
if ($exitWithError -eq "true")
{
Write-Host "Build task failed"
exit 1
}
else
{
Write-Host "Build task pratap"
exit 0
}

 

Can anyone suggest the changes I should do get the desired result.

 

Regards,

Pratap

  • Hi,

     

    I am also facing almost similar issue, can you please tell me how you have resolved this one.

    • PERSIN's avatar
      PERSIN
      Contributor

      Hi,

       

      I am also facing a similar kind of issues when I am trying to execute SOAPUI test through powershell script in VSTS. I clould see the logs as below:

       

      Start-Process : A positional parameter cannot be found that accepts argument xxxxx.
      At line:1 char:1
      + Start-Process -FilePath “C:\Program Files (x86)\Smartbear\SOAPUI\Bin\.. ...
      + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         + CategoryInfo          : InvalidArgument: (Smiley Happy [Start-Process], ParameterBindingException
         + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.StartProcessCommand

       

      Can you please tell me how you have resolved this issue. Below is my script:

       

      $testrunner = '.\Program Files\SmartBear\SoapUI-5.4.0\bin\testrunner.bat'
      $project = '$(System.DefaultWorkingDirectory)\SOAPUI Project\SOAPUI\xxxx.xml'
      $arguments = $project, '"-sTestSuite 1"', '"-RJUnit-Style HTML Report"'

      #Start-Process Powershell -FilePath $testrunner -ArgumentList '"$project"' , '"Set-ExecutionPolicy Restricted -Force"' -Verb RunAs
      Start-Process "powershell" -FilePath '.\Program Files\SmartBear\SoapUI-5.4.0\bin\testrunner.bat' -Verb runAs
      #start-process $(System.DefaultWorkingDirectory)\SOAPUI Project\SOAPUI\XYZ.xml
      if ($exitWithError -eq "true")
      {
      Write-Host "Build task failed"
      exit 1
      }
      else
      {
      Write-Host "Build task pratap"
      exit 0
      }

       

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        PERSIN I believe you posted this in the wrong forum.  Your question is about SoapUI, this forum is about TestComplete/TestExecute.

    • tristaanogre's avatar
      tristaanogre
      Esteemed Contributor

      Have you attempted any of the suggested solutions in this thread?

      Additionally, what are you using for your Powershell execution?  Please post your ps script code so we can help you debug.

      • PERSIN's avatar
        PERSIN
        Contributor

        Hello Robert,

         

        Thanks for reverting back.

         

        I am using the script in GIT repo in VSTS(Visual Studio Team Services) to execute SOAPUI test. I am using a power shell task in the build definition and then  I clould see the logs as below:

         

        Start-Process : A positional parameter cannot be found that accepts argument xxxxx.
        At line:1 char:1
        + Start-Process -FilePath “C:\Program Files (x86)\Smartbear\SOAPUI\Bin\.. ...
        + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           + CategoryInfo          : InvalidArgument: (Smiley Happy [Start-Process], ParameterBindingException
           + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.StartProcessCommand

         

        Below is my script:

         

        $testrunner = '.\Program Files\SmartBear\SoapUI-5.4.0\bin\testrunner.bat'
        $project = '$(System.DefaultWorkingDirectory)\SOAPUI Project\SOAPUI\xxxx.xml'
        $arguments = $project, '"-sTestSuite 1"', '"-RJUnit-Style HTML Report"'

        #Start-Process Powershell -FilePath $testrunner -ArgumentList '"$project"' , '"Set-ExecutionPolicy Restricted -Force"' -Verb RunAs
        Start-Process "powershell" -FilePath '.\Program Files\SmartBear\SoapUI-5.4.0\bin\testrunner.bat' -Verb runAs
        #start-process $(System.DefaultWorkingDirectory)\SOAPUI Project\SOAPUI\XYZ.xml
        if ($exitWithError -eq "true")
        {
        Write-Host "Build task failed"
        exit 1
        }
        else
        {
        Write-Host "Build task pratap"
        exit 0
        }

         

        Regards,

        Pratap