1

my question is simple. I was just wondering if it was possible to stop a TestSuite from running entirely in ReadApi 3.5.0 using a Groovy script test case.

I am able to jump to a specific TestCase and copy an error file and then cancel the testCase. However, the rest of the test suite still runs afterwars. Is there some way to stop the testSuite altogheter instead of cancelling the test step in my groovy script.

I use this code to skip to the correct testCase

if ( testRunner.testCase.testSuite.project.getPropertyValue( "EtapeX_succesfully" ) =='Oui' ) { 
    //do some logging later
} else {
    // Connecting to the test step in  project.
    project = testRunner.getTestCase().getTestSuite().getProject().getWorkspace().getProjectByName("End_To_End_X")
    testSuite = project.getTestSuiteByName("Test_Steps");
    testCase = testSuite.getTestCaseByName("Error_Occured");
    runner = testCase.run(new com.eviware.soapui.support.types.StringToObjectMap(), false);
}

After that, in the testcase I want to end the testSuite running , I have this code

import org.apache.commons.io.FileUtils
import java.nio.file.Path
import java.nio.file.Paths
import java.nio.file.Files
import static java.nio.file.StandardCopyOption.*;
import java.nio.*
import java.nio.file.*
    
String source = "\\\\networkPAth1\\someFolderX";
    
String destination = "\\\\networkPAth1\\someFolderY";
    
CopyOption opt = REPLACE_EXISTING
Path sourceLOG= Paths.get(source)
Path targetLOG = Paths.get(destination)
Files.copy(sourceLOG,  targetLOG  ,opt)
    
testRunner.cancel()

Thank you for your time.

Andrej Istomin
  • 2,527
  • 2
  • 15
  • 22
Simix48
  • 55
  • 1
  • 10

0 Answers0