- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to skip a particular test method from execution in Cucumber?
We can skip a particular test method from execution in Cucumber with the help of tagging of scenarios in the feature file.
Example
feature file.
@Regression Feature: Invoice Testing @Smoke Scenario: Login Verification Given User is in Home Page @Payment Scenario: Payment Testing Given User is in Payment Page
Feature file with scenarios having tags Smoke and Payment.
Example
import org.junit.runner.RunWith; import cucumber.api.CucumberOptions; import cucumber.api.junit.Cucumber; import cucumber.api.testng.AbstractTestNGCucumberTests; @RunWith(Cucumber.class) @CucumberOptions( features = “src/test/java/features”, glue = “stepDefiniations” tags = { “~@Payment”} )
To skip the scenarios with @Payment , ~ is placed before the @Payment tag in Test Runner file.
- Related Articles
- How to overlook a particular test method from execution in TestNG?
- How to skip a particular test method in TestNG?
- How to skip a selected test from execution in pytest?
- How does the execution of a particular test method depend on other test\nmethods in TestNG?
- How to set the order of execution for test methods in Cucumber?
- How to exclude a test from execution in Pytest?
- How to incorporate and remove test methods from execution from a\ncollection of test cases in TestNG?
- How to retrieve test method description in TestNG before and after execution?
- How to retrieve test method name in TestNG before and after execution?
- How to skip TestNG test at runtime?
- How to create a test runner file for Cucumber in Java?
- How to skip or ignore the execution of tests in TestNG?
- How to execute a particular test method multiple times (say 5 times) in\nTestNG?
- How to run precondition and postcondition test methods in Cucumber?
- How to run tests using a test runner file for Cucumber?

Advertisements