I try to add a tag in my feature file (using cucumber plugin within eclipse) but when I run my feature file it gives me an error:
Exception in thread "main" gherkin.TagExpression$BadTagException: Bad tag: "env" What am I doing wrong?
What I want is when I run the test, I want it to set the environment first before running the scenario:
Feature example:
Feature: Log into an account
@env
Scenario: Log Into Account With Correct Details
Given User navigates to stackoverflow website
Class for Environment setup:
@Before("env")
public void setEnvironment() {
System.setProperty("webdriver.chrome.driver", "xxx//chromedriver.exe");
this.driver = new ChromeDriver();
ActiveEnvironment = LivePortal;
EnvironmentUsed.add(ActiveEnvironment);
driver.manage().window().maximize();
}