Access to variable or path in the entire project

I have many different test cases and these access different files containing the test data.
I wanted to set the path as a variable so that if I want to change the folder I don’t have to change all the files.
is there a way to do this?

@Chris2046,

Use Global variable for this. I haven’t tried in test cases but it should work there as well.

Global variables can be set, but are not available across all test cases but only in one test case.

How about using assets then?

I want the path as a variable, is that possible with asset ?

@Chris2046,

In every test case you will have to use Get Asset and get the path. Global variable is the best practice as it’s designed for such kind of situations.

Hi @Chris2046

  1. Use global variables but…
    Global variables are available across all states in a state machine but when it comes to xaml files, global variables scope is only that xaml file so global variable defined in one xaml file is not accessible for another xaml file. In such cases, you would need to pass in that path variable as an argument to each of the other xaml files where you want to use that path.
    Good thing - you will just change the path variable in 1 main xaml file and in others it will automatically propagate the changes as you are using value from that xaml file to pass as an argument to other xaml files.

  2. Use assets but..
    you would have to use get asset in each of the xaml files to be able to use that path.
    Good thing - change the asset value in orchestrator, changes reflect in all xaml file where you are using get asset activity.

Or you would use get asset in 1 main xaml file and again would have to pass it as an argument in another xaml file.
Good thing - you will just change the asset in orchestrator and in others it will automatically propagate the changes as you are using value from that asset to pass as an argument to other xaml files.

Hope that helps.

Regards
Sonali

1 Like