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.
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
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
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
Please sign in to leave a comment.