已经尝试过几乎所有的解决方案,但仍然在这里丢失东西。黄瓜运行时无法获得结果。试图实施BDD
我已经创建了简单的JAVA程序,为黄瓜添加了功能文件和类。当我跑我得到的输出:
@Search方案概要:成功打开Google.com [90米# Open_Google.feature:40米 [36mGiven [0分[36mUser是空白页[0米 [ 36mWhen [0分[36mUser输入网址[0米 [36mThen [0分[36mGoogle网站应该打开[0米
0场景
0步骤
0m0.000s
特性文件:
Feature: Open Google WebSite
@Search
Scenario Outline: Successful Open Google.com
Given User is with blank page
When User enter URL
Then Google WebSite should open
测试运行器类:
import org.junit.runner.RunWith;
import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;
@RunWith(Cucumber.class)
@CucumberOptions(
features = "Feature"
)
public class TestRunner {
}
测试用例类:
public class cucumber_test {
public static WebDriver driver;
public static void main(String[] args) {
// TODO Auto-generated method stub
System.setProperty("webdriver.chrome.driver", "D:\\chromedriver.exe");
driver = new ChromeDriver();
driver.get("http://www.google.com");
driver.manage().window().maximize();
System.out.println("Google open successfully");
}
}
使用硒Webdriver,JAVA,Junit和黄瓜。
我也在做对吧?使用黄瓜是否正确?
感谢您的帮助,现在它说_ **没有在发现功能[classpath中:Cucumber_Sample /专题] ** –