Java 在中运行文件时发生初始化错误
下面给出了3个不同的文件详细信息:功能文件/流道文件和步骤定义文件Java 在中运行文件时发生初始化错误,java,selenium,cucumber,Java,Selenium,Cucumber,下面给出了3个不同的文件详细信息:功能文件/流道文件和步骤定义文件 @featureTest Feature: Test Facbook smoke Scenario @Scenario1 Scenario: Test Login with valid Credentials Given Open chrome and start application When I enter valid username and valid password The
@featureTest Feature: Test Facbook smoke Scenario
@Scenario1 Scenario: Test Login with valid Credentials
Given Open chrome and start application
When I enter valid username and valid password
Then User should be login sucessfully
请检查功能文件路径。尝试使用功能文件的绝对路径,该路径区分大小写。因此,请检查相同的要素文件名。例如,如果将要素文件保存在项目的“要素”文件夹下 请尝试以下代码
import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;
@RunWith(Cucumber.class)
@CucumberOptions(features="classpath:Features")
public class testrunner {
}
您正在为步骤定义设置粘合路径。即使您解决了上述错误,您也将得到步骤定义未找到错误。除非或直到您将该类保留在项目目录中。是否可以添加异常stacktrace?
import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;
@RunWith(Cucumber.class)
@CucumberOptions(features="classpath:Features")
public class testrunner {
}