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 do perform drag and drop using selenium webdriver?

0 Answers  


i am a 2013 BE and 2015 M.tech passed out.i have taken course in manual testing with selenium automation.i have confident that, i have required technical knowledge in manual as well as automation.now my problem is whether to go as fresher or keep 3 years of experiance.there are very few interviews to call 2013 b.tech and no calls for M.tech...!!is it make any problem, if i keep fake.please let me clear my doubt

0 Answers  


How to set test case priority in testng?

0 Answers  


How to create and run testng.xml?

0 Answers  


What is the syntax of finding elements by id using css selector?

0 Answers  






What programming languages are you able to use in selenium rc?

0 Answers  


How can we create object repository in selenium?

0 Answers  


How to execute a single line command from selenium ide?

0 Answers  


What are the Different Types of Waiting in the WebDriver?

1 Answers  


What is the difference between the commit and verify commands?

0 Answers  


What do you mean by selenese?

0 Answers  


Explain what does @test(invocationcount=?) And @test(threadpoolsize=?) Indicate.

0 Answers  


Categories