Last activity: 17 Aug 2020 2:52 EDT
Test Data during Scenario Testing
We are exploring Scenario testing on Pega 8.1 and we are unable to provide test data to run the tests. Data captured during the first run is always used as the test data. Can we provide a Data Transform or an Activity rule that can supply test data to the scenario test cases?
You can use data transform to provide test data to scenario test cases.
To add a little more helpful suggestion, you need to update a data page D_pyScenarioTestData which can be supplied with the test data. This can then be populated as follows (for the appropriate input fields)
Thanks Linoy. This is very helpful.
While setting up test cases using Scenario testing, I am trying to add an explicit assertion on a property of type Integer. I want to check if the amount is greater than a certain value. However, there is no other comparator other than the "equal to". How do I set the test case for this requirement.
Attached is a screenshot.
At this point the only supported validation equal to. You can do regular expressions, although it would get fairly complicated and maintaining the comparison, for example here is one possible regular expression to use for this, which I found by ^(?:[1-9]\d+|[2-9])$ searching Google. For how to specify regular expressions see the post Scenario testing: How to create, run & Edit test cases.
i modified the pyScenarioTestData datatransform to define the testing data, however the data is not loaded to the scenario test cases. anything else I need to configure?
After modifying data transform, are you using the data page in any of the test case step?
screen shot would help to understand how you have used the data page in test case step.
Updated: 7 Aug 2020 5:24 EDT
the datatransform loads the data into the data page D_pyScenerioTestData. For scenario tests, you need to modify the step, and change the value for which you want to pass the dynamic data. Replace the string value with D_pyScenerioTestData.<property name>
During scenario test execution, the datapage will be loaded with the data( mentioned in the data transform), and during that step execution dynamic data will provided (as you have modified and changed the value to be taken from data page reference)
check Providing Dynamic data to the test case in the above URL. after updating the data transform, they have updated the step value in testcase and given a reference to the datapage value "AccountOwner"
Can we use a single scenario test case to run with multiple sets of data using D_pyScenerioTestData?