How do you Skip Test Case from execution?

Answers were Sorted based on User's Feedback



How do you Skip Test Case from execution?..

Answer / naazneen

There are two ways to skip a test case :

1. By using testNg annotation , enabled=false

Eg: @Test(enabled=false)
Public void testCase(){
// code
}

2. By using "Skip Exception"

Eg: @Test
public void testCase1(){
throw Skip Exception(" skipping the test ");
}

Is This Answer Correct ?    12 Yes 0 No

How do you Skip Test Case from execution?..

Answer / elakkiya

In Testng, we can skip method like below,

@test(enabled=false)
public void test()
{
// body
}


In JUnit, we can skip method and as well Class like below,

Class:
--------
@Ignore
public class IgnoreMe {
@Test public void test1() { ... }
@Test public void test2() { ... }
}

Method:
-----------
@Ignore
@Test
public void something() { ...

Is This Answer Correct ?    3 Yes 0 No

How do you Skip Test Case from execution?..

Answer / shahid qureshi

by @Ignore annotations

Is This Answer Correct ?    0 Yes 1 No

How do you Skip Test Case from execution?..

Answer / anagha

In testNg there is annotation
enabled =true

so it can be like this

@test(enabled=true)
public void test()
{
// body
}

Is This Answer Correct ?    6 Yes 8 No

Post New Answer

More Selenium Interview Questions

How to do drag and drop in selenium?

1 Answers  


What exactly is the price of selenium test-suite?

1 Answers  


What is the purpose of selenium ide?

1 Answers  


How to get the title of the page?

1 Answers  


What are driver.close and driver.quit in WebDriver? Which is more preferable?

1 Answers  


Which are the browsers supported by selenium ide?

1 Answers  


How to handle alerts in selenium?

1 Answers  


List some scenarios which we cannot automate using selenium webdriver?

1 Answers  


What is the command that is used in order to display the values of a variable into the output console or log?

1 Answers  


What’s the difference between borland silk evaluation and selenium?

1 Answers  


What is parameterization in testng? How to pass parameters using testng.xml?

1 Answers  


Which is the latest Selenium tool?

1 Answers  


Categories