divman
11 years agoContributor
[Res]How to call & run test step from another project?
Hi,
I have two projects like below.
P1
---TS1
-----TC1
-------GScript 1
P2
---TS2
-----TC2
-------GScript 2
here i need to run a script in 'Gscript 2' which will need to call and run the 'Gscript 1'. i am using the below code and i get "java.lang.NullPointerException". could anyone help me how to achieve this?.
I have two projects like below.
P1
---TS1
-----TC1
-------GScript 1
P2
---TS2
-----TC2
-------GScript 2
here i need to run a script in 'Gscript 2' which will need to call and run the 'Gscript 1'. i am using the below code and i get "java.lang.NullPointerException". could anyone help me how to achieve this?.
def step = testRunner.getTestCase().getTestSuite().getProject().getWorkspace().getProjectByName("P1").getTestSuiteByName("TS1").getTestCaseByName("TC1").getTestStepByName("GScript 1")
log.info step.name
testRunner.runTestStepByName(step.name)