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 |
Which of the selector ID, name, XPath or CSS should I use?
What will be the limits of selenium?
What are the different types of web controller APIs supported in Selenium?
What are the significant changes/upgrades in various selenium versions?
difference between Implicit Wait and Explicit Wait with syntax.?
Other than the default port 4444 how you can run selenium server?
What are the types of waits available in selenium webdriver?
Tell me how do perform drag and drop using selenium webdriver?
What are the different types of wait statements in selenium webdriver? Or how do you achieve synchronization in webdriver?
What is the difference between driver.getwindowhandle() and driver.getwindowhandles() in selenium?
How does one execute java scripts function in selenium?
What programming languages does Selenium use?