New answers tagged

3

Hi you can use multiline argument (docstring) for this: https://cucumber.io/docs/gherkin/reference/#doc-strings Your step definition: Here you pass the json between """ and """ Given a blog post named "Random" with Markdown body """ { "benefitPlanIDs": [ { "benefitPlanID": "011748abc", "benefitPlanPlatform": "abc" } ], "clientId": "abc", "...


2

I'm assuming you are using Java in your testing framework. You have two ways of achieving it. Option 1: Try using Karate framework. If you use Java and want to do easy API testing. Option 2: Table is an object with fields named accordingly to table header. Basically you need to serialize them to json in a way that is suitable. You can use gson library ...


1

In CucumberJS you can use a setWorldConstructor where you can create for example a this.context which can we used in each steps and hooks I think. For an example code look here: https://github.com/cucumber/cucumber-js/blob/0b2d7e468cf10ecef37749efaddd2dfbea8c7808/features/generator_step_definitions.feature Other reads: Use arrow notation to use world this ...


0

You can use the following method to clear text fields, it is tested on different types of input fields public boolean clearTextField(Object locator) { _element = _query.castLocator(locator); if (toBeCleared(_element)) { _element.clear(); } if (toBeCleared(_element)) { _mouse.click(locator); // simulate select all text ...


Top 50 recent answers are included