0

Just require some help with syntax whilst using wildcard parameters in Java.

If my feature file contains a data table with the following wildcard:

Given I enter the following text
|text    |
|{string} |

In my step definition, I want to replace {string} with any random text. I know how to retreive the value of the first index from the column, but how do I set that value to the random text?

@Given("^I enter the following text$")
public void Ienterthefollowingtext(DataTable text)  {

  String RandomStringUtils.randomAlphanumeric(7);

    List<Map<String, String>> list = text.asMaps(String.class, String.class);  
    String text = list.get(0).get("text");
}

;

BruceyBandit
  • 3,978
  • 19
  • 72
  • 144

0 Answers0