0
@BeforeSuite
public void requestToken(ITestContext context) {
    
    String response = context.getCurrentXmlTest().getClasses().toString();
    String[] tests = response.split(",");
    System.out.println(response);
    for(int i=0;i<tests.length;i++){
        tests[i]=tests[i].replaceAll("\\[", "").replaceAll("\\]","").replaceAll("\"", "");
        String[] test = tests[i].split("\\.");
        String currentScript = test[test.length-1];
        
    }
}

In variable currentScript class name is getting stored. I want to create an object of this class.

0 Answers0