Answered

Unable to retrieve system environment values

Requirement :  Need to define global variables which can be reused in any other function or automated test case.

Approach followed : I was unable to find any direct way to define global variables. But i saw some(4-5) system variables in the variable list while variable value assignment and while execution. 

So, i added some system environment variables using Execute_Command in subject 7:

The variable is being added in the system environment variables list, but I'm unable to fetch these values back into Subject 7. I tried assigning system variables value to my sample variable defined, but after entering @, it only shows the default 5 system environment variables only. 

I tried echo %variable% also, but it didn't work.

Any suggestion on this, will be highly appreciated.

0
7 comments
Avatar
Joseph Hamdan

Hi Maddy,

We are working on this feature that allows setting global variables and using them in test cases and executions. It is planned for a future release, but we will let you know once an update is available.

Thank you for your patience.

Regards,

Subject7 Team

0
Comment actions Permalink
Avatar
Joseph Hamdan

Hi Maddy,

Could you please provide us in as much detail as possible what you are trying to do with global variables?

It would be helpful for us to know as many scenarios as possible for feature development.

Regards,

Subject7 Team

0
Comment actions Permalink
Avatar
Maddy

Thanks Joseph. 

I am trying to setup a chained execution with global variables.

Will wait for the feature to be added.

0
Comment actions Permalink
Avatar
Joseph Hamdan

Maddy,

Thank you for your response, however I was hoping you can share the actual scenario. Meaning, why the test cases have dependency? Why is it not possible for you to have all the required steps on one test case. Can you share high level what your test case does? This information will greatly help us understand your needs and provide more relevant implementation of the feature.

Regards,

Subject7 Team

0
Comment actions Permalink
Avatar
Maddy

Sure.

Lets say we have 3 different test cases:

1. login, Creates an order and logout

2. login to app and edit the order and logout

3. login again and make payment for the order

 

Here, we'll need order number(which is getting generated at run time in test case1 ) to be passed for each test case.

Is there any existing feature which can serve the need? Please advise

0
Comment actions Permalink
Avatar
Joseph Hamdan

Hi Maddy,

Can you try creating functions for each of these scenarios and then call them into a single test case using Call command? That way, any variables defined can be used into this single test case.

When finished, your test case should look like this:

1- Call "login_function" / (login, create order and store number in variable_1)

2- Call "modify_function" / (edit order number and store it in variable_2)

3- Call "payment_function" / (use order from variable_2 and make payment)

 

Could you please try and let us know if this works?

 

Regards,

Subject7 Team

0
Comment actions Permalink
Avatar
Maddy

Actually all the 3 test cases are different/unit test cases.
I'll try the given approach. Thanks for the guidance.
Meanwhile, is there any way to read and assign system environment values to a subject 7 variable (something using Execute Command).

0
Comment actions Permalink

Please sign in to leave a comment.