I am having 4 Rest API’s Projects as of attached screen shot.
I Need to pass a generated userID from project 1 (1_Admin Basics & Get APIs) to other project (2_Courses & Classes).
I am running each project by using test runner. Global property transfer is not working in this scenario. Can some 1 help me out to do the above mentioned scenario.
I don’t want to combine 4 projects into 1 project. It should be 4 projects and need to pass the parameter from 1 project to other.
You can do it for example using the
workspace
property to access the other projects from the current one to get the properties from its. You can do it through a groovy script.In the first project add a groovy script testStep in your testCase and set the property at project level as follows:
In the second project add another groovy script in the testCase to get the value of your property through the
workspace
and assign at your desired level (for example in a testSuite, but you can add wherever you need it):Then use the variable in the testStep of your second project using the follow notation:
${#TestSuite#varFromOtherProject}
UPDATE:
Seems that you're running your projects alone using testRunner therefore you can't access other projects using
workspace
, so as a possible workaround you can write your property value in a File in your first project and then read the File content in your second project.So in your first project add a groovy script testStep with the follow code:
Then in your second project read the File and set the property at some test level:
And as it's explained before use the follow notation in your SOAP testStep to get the property:
${#TestSuite#varFromOtherProject}
Hope it helps,