How do you Skip Test Case from execution?
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
What is testng?
How to handle keyboard and mouse actions using selenium?
What are the different components of the selenium?
Explain what are the different types of locators in selenium?
How to use frame elements in Selenium on a page?
Tell me how to verify tooltip text using selenium?
How to assert title of the web page?
what is the difference between keys.enter and keys.return in selenium? i have used both and both performed enter.
1 Answers JPMorgan Chase, Tech Mahindra,
What are the test types supported by selenium?
Mention what are the advantages of using git hub for selenium?
What is the purpose of creating a reference variable- ‘driver’ of type
What is the difference between selenium and sikuli?