How to implement SuccessPercentage in TestNG

Hi ,
I am a newbie in TestNG and learning the TestNG annotaions from toolsqa and but there isn’t any example explaining this parameter.

Can anyone explain with code the example of successpercentage? and

what is use of this in real world example?

Thanks! in advance 🙂

I am using the below code using success percentage as 100 but always it passes.I guess it shoud not pass because two iterates are failing here

package Pack;


import org.testng.annotations.Test;

public class SuccessPercentage {

@Test(timeOut = 10000, invocationCount = 1, successPercentage = 100)
public void waitForAnswer() throws InterruptedException{
int i=10;
while (i>2){

catch(Exception e)



Default Asked on June 21, 2015 in Selenium WebDriver.
Add Comment
  • 0 Answer(s)
  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.