Contributions
Re: Running a branch in parallel
So from the looks of it this isn't the exact route I was attempting to go (though that could just be because I'm so new to the program), but it did make me realize another way to write the test cases that would allow me to use the method you mention. So thank you!5 years agoPlace ReadyAPI QuestionsReadyAPI Questions1.4KViews0likes0CommentsRunning a branch in parallel
Hello, Obligatory "first post here, so please be gentle." I'm attempting to run two test cases in parallel but only after a specific test step has been run in my first test case. The APIs I'm testing require a dynamic authorization token in the header that changes every 60 seconds after a specific API request has been sent. Presently I have a groovy script in the first test case to run a groovy script in second test case that contains a while loop to continuously run the second test case while the first test case is running (there is a groovy script at the end of TestCase1 to set the 'running' property to 'false' to stop the loop). However, the first test case comes to a halt as it waits on the second test case's loop instead of branching to start the second test case in parallel while continuing with the first. Is it possible to accomplish this task within the confines of the program? Test case 1's script: def hello = testRunner.testCase.testSuite.project.getTestSuiteByName('BaseClientPortalTesting').getTestCaseByName('HeartbeatFlow').getTestStepByName('startLoop') hello.run(testRunner, context); Test case 2's script def thread = Thread.start{ def running = context.expand('${#TestSuite#RUNNING}').asBoolean(); def runTimes = 0; while (running){ runTimes++; log.info(runTimes); running = context.expand('${#TestSuite#RUNNING}').asBoolean(); testRunner.runTestStepByName("Heartbeat"); def Response = context.expand('${Heartbeat#Response}'); if (Response != "true"){ testRunner.runTestStepByName("RefreshToken"); sleep (1000); testRunner.runTestStepByName("TransferRefreshedToken"); } else { sleep (60000); } } } thread.join(); Thanks!Solved1.5KViews0likes3Comments