首页 > 解决方案 > Feature file 'scenario outline' data array item not being picked by in Step Definition

问题描述

I set up a Feature File with a scenario outline, but then I can not use the data array item in my step definition file.

i.e. 'address' is my feature file data array item, but in my step definition file, 'address' is underlined by Eclipse IntelliSense as an error and this gives an 'Arity mismatch' message if run.

我是自动化新手,希望我的步骤定义能够获取功能文件场景大纲数组数据。谁能发现我做错了什么?

Feature: Login
Scenario Outline: Successful login
Given HomePage '<address>'
When ValidCredentials
Then LoginSuccessfull

Examples:
|address|
|https://totaljobs.com|


//Step Definition extract 
@Given("HomePage '(.*?)'")
public void HomePage() {
driver.get(address);
driver.manage().window().setSize(new Dimension(1536, 792));
System.out.println("Chrome opened");
String url = driver.getCurrentUrl();
System.out.println("Current url:" +url);
}

标签: intellisense

解决方案


推荐阅读