Forum Discussion

SlickRick's avatar
SlickRick
Frequent Contributor
2 years ago

Azure Pipeline - Variables Not passed to my test

Hi all, 

So I have a project suite in which I have defined a variable 'AppPath' which points to the directory where my exe is located.

 

In my pipeline I follow (i believe) all the steps required from Run TestComplete Tests as Part of a Pipeline | TestComplete Documentation (smartbear.com)

 

So I do pass the variable to the testexecute.

 

However for some reason it doesn't seem to work.

and get an error: Unable to run "SESFFT"


Please note that I have verified that the path injected to TestExecute is correct and the exe is at the expected location.

 

When i hardcode the expected path in the TestComplete variable, the test works on the build server.

 

What i weird is that during my trial i managed to make it work and was working fine. Obviously i must have change something which broke it.

 

I do have multiple questions:

1 -  Anyone knows what can be wrong? It seems like passing the Variable  in the TestComplete adapter is not working

2 - Is there a way to improve the debug message output from TestExecute. Current I the error shown is something like 'Path not found' but i dont see what is the path that it tried. It is very hard to debug when you cant see what values are being tried.

 

Also i have tried using a project variable instead of a project suite variable. No luck.

 

Thank you for the help.

  • I figured it out! ğŸ˜€

     

    TestExecute was opened on the build server which was failing.

     

    Therefore my pipeline was using the opened instance to run the tests (which was opened i guess with no params).

     

    By closing it, the pipeline would open a new instance with the correct parameters.

    I would suggest to have a option on the 'Enable support for testcomplete test' task to 'Force new instance' that would auto-reload the tool to ensure that the correct param are used.

     

    Thank you!

  • SlickRick's avatar
    SlickRick
    Frequent Contributor

    I figured it out! ğŸ˜€

     

    TestExecute was opened on the build server which was failing.

     

    Therefore my pipeline was using the opened instance to run the tests (which was opened i guess with no params).

     

    By closing it, the pipeline would open a new instance with the correct parameters.

    I would suggest to have a option on the 'Enable support for testcomplete test' task to 'Force new instance' that would auto-reload the tool to ensure that the correct param are used.

     

    Thank you!

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi,

     

    It seems like passing the Variable  in the TestComplete adapter is not working

    It works for sure. Well, at least it works for our pipelines.

    Azure has strange and non-explainable for me concept of runtime and design-time variables.

    What I would do is to add a step between Test Adapter and Run UITests steps and output the value of the Build.BinariesDirectory variable. If the value is correct, then I would pay attention if it contains spaces. Extra quotes might be required if it does.

    Additionally, add debug message to test log in TestComplete and output the value of AppPath variable and again, check if it contains expected value.

     

    The bottom line: your approach is a valid one and matches to what we have in our pipelines, so it definitely can be used. What you need to do is to ensure that correct expected value is passed to Test Adapter.

     

    P.S. Our pipeline is in YAML format and corresponding part for Test Adapter looks like this:

          inputs:
            installExecutortrue
            updateExecutorfalse
            searchModeProjectItems
            logsLevel0
            accessKey'$(SBAK_ALK)'
            cmdLineParams'/pv:pvClient="$(clientsToTest)"'
            preferredExecutorTE

     

    where clientsToTest variable evaluates to something like this (without quotes): 'cl1;cl2;cl3;'

     

  • SlickRick's avatar
    SlickRick
    Frequent Contributor

    Hi there,

     

    On my pipeline I do have a step to print the AppPath that im passing to the TestExecute and that path is ok.

     

    As your suggestion, I added a testcomplete printout of the AppPath variable.

     

    Suddenly by adding this, my test suddenly start to pass... Not too sure what went wrong initially...

     

    Thank you!

     

  • SlickRick's avatar
    SlickRick
    Frequent Contributor

    Well I talked a bit too soon.

    So it works on one of my build server and on another it fails.

     

    On the machine that fails, the variable returns the default value, but the variable being passed to TestExecute is ok (looking at the pipeline log).

    Also it seem like no param are considered on that build machine since I also have a /DoNotShowLog  tag and the log is shown on the build server after the run is done.

     

    you were talking about runtime and design-time variables. How can we determine and setup which one to use?