2

In my previous question I was looking for a way to access and store return value of the function in qaf step. I was provided with the following:

When create new user using "{'name':'user1','password':'user123'}"
And store into 'newUser'
Then system should have user '${newUser}'

Now, I'd like to know how to get value from object/collection stored. If it is a simple object named newUser which has field Id. How would I pass Id on next step?

And, if return is List, how to get by index from stored list?

user861594
  • 5,733
  • 3
  • 29
  • 45
user3812972
  • 77
  • 1
  • 6

1 Answers1

2

Resolved issue on my own. If anyone faces same unknowns, here is how I solved it.

For requirements to work around response data, parsing same stored objects in properties by specific fields or collecting data from other structures such as Maps or Lists, create common functions with @QAFTestStep annotation to get data for class member name, map by key or list by index and so on... Add those in common steps and then write stepname text in gherkin format with parameters specified. Let me know if someone needs help, always ready to help out...

user3812972
  • 77
  • 1
  • 6