Feixiong Liu
Feixiong Liu

Reputation: 443

How to exclude some selenium test cases from the package?

I have a test cast package setup to run. However, there are some test cases in the package I want to exclude. How should I do it if I do not change the code? as far as I know testng does not have feature that to exclude single test case inside the package.

Upvotes: 0

Views: 1893

Answers (2)

Shadowheim
Shadowheim

Reputation: 56

As you are using TestNg, the easiest option is adding (enabled = false) after the @Test annotation.

@Test(enabled = false)
public void yourTestMethod() throws Exception {
//your code here
}

See here for information on annotations.

Upvotes: 1

Aru
Aru

Reputation: 134

You can exclude methods and groups in TestNG,see [here.][1]


  [1]: http://testng.org/doc/documentation-main.html#testng-xml

I am able to exclude method using following code :

<classes>
      <class name="scripts.CheckTest" />
      <class name="scripts.Day1" >
          <methods>
              <exclude name="verifyMobilePageTitle" />
          </methods>
      </class>
</classes>

Upvotes: 0

Related Questions