I want to print the Parameters passed to this method using Listners.
@Test
@Parameters({"browsername","URL", "ebrowse","eURL"})
public static void LaunchApplication(String browsername, String URL, String ebrowse, String eURL ) throws InterruptedException, IOException{
I have used the following code:
public void onTestSuccess(ITestResult result) {
System.out.println("\nThe method is in " +result.getTestClass().getName());
String paramet = null;
for(Object parameter : result.getParameters()){
paramet += parameter.toString() +",";
}
System.out.println("The parameters of the method are: " +paramet);
}
Output:
The parameters of the method are: nullch32,http://localhost:90/fintech/login.html,ch32,http://localhost:90/fintech/login.html,
The output I get is the values that are passed to the parameter. Also it prints the null that I have used to initialize the String. How do I eliminate the null and print the parameters only and not values?