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 ?    2 Yes 0 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 7 No

How do you Skip Test Case from execution?..

Answer / shahid qureshi

by @Ignore annotations

Is This Answer Correct ?    0 Yes 1 No

Post New Answer



More Selenium Interview Questions

When to use assert, verify and waitfor in selenium?

0 Answers  


From your test script how you can create html test report?

0 Answers  


How do perform drag and drop using webdriver?

0 Answers  


Different types of synchronization

1 Answers  


Why should Selenium be selected as a testing tool?

0 Answers  






How to select a value in a dropdown?

0 Answers  


Explain me what are the main advantages of selenium?

0 Answers  


How does selenium score over other automation tools like hp qtp, ibm rft, and testcomplete?

0 Answers  


Explain me how many types of webdriver apis are available in selenium?

0 Answers  


Can WebDriver test mobile applications?

0 Answers  


What is the command line we have to write inside a .bat file to execute a selenium project when we are using testng?

0 Answers  


what is the difference between type keys and type commands?

0 Answers  






Categories