Name Option

In BDD using Cucumber, the **name** option is used inside the @CucumberOptions annotation to filter and run scenarios by their names or titles (based on matching text). This is especially useful when you want to run only a specific scenario without tagging it.

It performs a partial match on scenario names (case-sensitive).
You can provide multiple names in the array: name = {"Login", "Balance"}

Feature: Netbanking Login page Display
@MonoCh
Scenario: Navigate to Axis Bank LoginPage
Given Click on Axisbank URL
When Click on NetBanking Link
Then Navigate to Netbanking LoginPage

Feature: Application Generate
Scenario: Install Application
Given Click on Playstore
When Search the Application
Then click on Install Icon
=====================
package testRunner;
import io.cucumber.testng.AbstractTestNGCucumberTests;
import io.cucumber.testng.CucumberOptions;

@CucumberOptions(features="src/test/java/Features", glue="Steps", monochrome=true,
name = {"Check presense", "Axis Bank LoginPage"})
public class NameTestRunner extends AbstractTestNGCucumberTests{
}
=====================

OutPut:

login form visible
username and password fields are visible
Click on Axisbank URL
Click on NetBanking Link
Navigate to Netbanking LoginPage
PASSED: io.cucumber.testng.AbstractTestNGCucumberTests.runScenario("Check presense of login elements", "Login Functionality")
Runs Cucumber Scenarios
PASSED: io.cucumber.testng.AbstractTestNGCucumberTests.runScenario("Navigate to Axis Bank LoginPage", "Netbanking Login page Display")
Runs Cucumber Scenarios
===============================================
Default suite
Total tests run: 2, Passes: 2, Failures: 0, Skips: 0
===============================================


Note: Name option will search for the string "Check Presence, Axis Bank LoginPage" in all the feature files..

if keyword exists in scenario, that scenario will execute