How to bind global param to all test cases
Posted: Fri Dec 16, 2011 9:35 pm
Hi, I've gone through the tutorial but I'm still fairly new to Ranorex so please bear with me.
My test suite contains test cases that will always refer to the same client name. For ex. in TC1, I select the client from a dropdown while in TC2, I enter the client name in a text box. I've set the client name to be a repo variable (repo.clientName) to be used for TC1 and TC2. I have a global parameter where I set the actual client name and from what I understand, I would need to bind this with the clientName variable for each test case. Is there a way of binding the global parameter to the repo.clientName for each test cases using a code module and have this code module run at the beginning of each TC? Basically, I want to avoid having to go to every TC and bind the global parameter.
I tried the following code but the client name being used is still the default value set in the repository.
private Controller.ControllerRepository repo = Controller.ControllerRepository.Instance;
repo.clientName = "Test Company";
Thanks
Patrick
My test suite contains test cases that will always refer to the same client name. For ex. in TC1, I select the client from a dropdown while in TC2, I enter the client name in a text box. I've set the client name to be a repo variable (repo.clientName) to be used for TC1 and TC2. I have a global parameter where I set the actual client name and from what I understand, I would need to bind this with the clientName variable for each test case. Is there a way of binding the global parameter to the repo.clientName for each test cases using a code module and have this code module run at the beginning of each TC? Basically, I want to avoid having to go to every TC and bind the global parameter.
I tried the following code but the client name being used is still the default value set in the repository.
private Controller.ControllerRepository repo = Controller.ControllerRepository.Instance;
repo.clientName = "Test Company";
Thanks
Patrick