selenium – Cucumber Spring Framework to automate Google Calculator query
selenium – Cucumber Spring Framework to automate Google Calculator query
Did you try to use the @Then like as below to compare the answer from table?-
@Then(^I should get the correct answer ([^]*) again$)
public void thecorrectanswertest2(String answer) throws Throwable{
WebElement calculatorTextBox = webDriver.findElement(By.id(cwtltblr));
String result = calculatorTextBox.getText();
if(answer.equalsIgnoreCase(result))
System.out.println(Test Passed);
}
Try this once. It should work