4
要素の作成ボタンをテストするための機能ファイルを作成しました。しかし、それはエラーメッセージcucumber.runtime.CucumberExceptionのエラーは何ですか:Arity mismatch:Javaでのセレンのステップ定義
のcucumber.runtime.CucumberException: Arity mismatch: Step Definition.
私は自動テストに新しいので、なぜ起こって知りません。
以下は私が書いたコードです。
@When("^create elements$")
public void create_elements_for_attributes(WebElement elementToClick) throws Throwable {
driver.findElement(By.id("newElement")).click();
}
私が受け取ったエラーは次のとおりです。あなたがタイプWebElement
の一つの引数を期待しているが、あなたの正規表現は、任意の引数をキャプチャしていない、あなたのcreate_elements_for_attributes
方法で
cucumber.runtime.CucumberException: Arity mismatch: Step Definition 'mCollector.features.StepDefinitions_mCollector.create_elements_for_attributes(WebElement) in file:/C:/Users/Admin/workspace/MStudio%20-%20eBilling/bin/' with pattern [^create elements$] is declared with 1 parameters. However, the gherkin step has 0 arguments [].
以下の回答は役に立ちましたか? –