Forum Discussion

mercyadewoye's avatar
mercyadewoye
Occasional Contributor
3 years ago

TFS Azure: How to configure testcomplete to take the build path, instead of specifying in script

Hi, 

I am trying to run automated tests on our nightly builds and I have specified the path in the command line script, however, the build path is bound to change sometimes. Is there a way testcomplete can be configured to take the build path instead of specifying the path manually in the command line script. 

  • Hello,

     

    We have a TestComplete Test Adapter than can be implemented into Azure Pipelines projects, this allows you to specify a Search Folder and Test filter criteria to find/run applicable tests. This would be one way to avoid having baked in locations in scripts that launch TC/TE. With this adapter installed it can interact directly with either tool without the need for CLI scripts as well. Below is a link to setup of this adapter. I hope this would be relevant to your use case. 

     

    https://support.smartbear.com/testcomplete/docs/working-with/integration/azure/test-adapter/index.html

  • you could use the azure devops plugins as npaisley mentioned. (which will actually work as a COM server, not CLI)

    you can also continue to use the CLI instead as you are doing. 

    Im assuming you are doing something like

    <path to testcomplete or testexecute exe> <path to project suite file> <a set of runtime arguments like /r /p /e etc.>

    where you are asking about how to make that highlighted path to the pjs to run more dependable.

    Since you are using pipelines, im going to assume that you are actually pulling the code from a SCM like github etc. (whatever your org uses).

    Then, this path can be referred to using Azure's predefined variables such as :

       $(Build.Repository.LocalPath)
    and you can browse the full list of variables available to you here
  • you could use the azure devops plugins as npaisley mentioned. (which will actually work as a COM server, not CLI)

    you can also continue to use the CLI instead as you are doing. 

    Im assuming you are doing something like

    <path to testcomplete or testexecute exe> <path to project suite file> <a set of runtime arguments like /r /p /e etc.>

    where you are asking about how to make that highlighted path to the pjs to run more dependable.

    Since you are using pipelines, im going to assume that you are actually pulling the code from a SCM like github etc. (whatever your org uses).

    Then, this path can be referred to using Azure's predefined variables such as :

       $(Build.Repository.LocalPath)
    and you can browse the full list of variables available to you here
    • mercyadewoye's avatar
      mercyadewoye
      Occasional Contributor

      I'm not sure these address my question. My question is regarding the path to the build that is getting tested. 

      The script I have run is as follows:

      "C:\Program Files (x86)\SmartBear\TestExecute 14\Bin\SessionCreator.exe" RunTest /UserName:**** /Password:***** /UseActiveSession /ScreenResolution:1920*1080 /ProjectPath:"C:\Projects\***\60\s\TestComplete\TestCompleteAutomationSuite\TestProjectFMSmokeTest\TestProject-FMSmokeTest.pjs"/ExportLog:"C:\temp\AutoTest.mht"/ExportSummary:"C:\temp\AutoTest.xml" /Timeout:600
      /SelfHealing:Off /test:"C:\AzureAgent\_work\1\s\TestComplete\TestCompleteAutomationSuite\Scripts\Test_End_to_End_Create_New_Order_From_Master.svb"

       

      The highlighted 60 in project path can be any random number resulting in error if different from what was specified. Is there a way to edit this script or get test execute to get the path dynamically? Also, please see below my set up and advise accordingly. Thanks

       

      • hkim5's avatar
        hkim5
        Staff

        this path (in your case something like "c:/agent/_work/60/s) can be referred to using Azure's predefined variables such as :

           $(Build.Repository.LocalPath)
        and you can browse the full list of variables available to you here

         

         

        so something like 

        /ProjectPath:"$(Build.Repository.LocalPath)\TestComplete\TestCompleteAutomationSuite\TestProjectFMSmokeTest\TestProject-FMSmokeTest.pjs"/ExportLog:"C:\temp\AutoTest.mht"/ExportSummary:"C:\temp\AutoTest.xml" /Timeout:600
        /SelfHealing:Off /test:"$(Build.Repository.LocalPath)\TestComplete\TestCompleteAutomationSuite\Scripts\Test_End_to_End_Create_New_Order_From_Master.svb"

         

        of course it's up to you to figure out the relative path of the folders, projects, and paths as it relates to that build directory

  • Hello,

     

    We have a TestComplete Test Adapter than can be implemented into Azure Pipelines projects, this allows you to specify a Search Folder and Test filter criteria to find/run applicable tests. This would be one way to avoid having baked in locations in scripts that launch TC/TE. With this adapter installed it can interact directly with either tool without the need for CLI scripts as well. Below is a link to setup of this adapter. I hope this would be relevant to your use case. 

     

    https://support.smartbear.com/testcomplete/docs/working-with/integration/azure/test-adapter/index.html