Functionality we want to achieve:
Instead of creating different multiple test cases we want to use a For Loop to run all of them from a list.
Expected results
The test case keeps running and creating the records/entering the field values and clicking on the buttons (new/submit and button1 (used for debugging)) according to the number of items in the FOR-loop list.
Problem:
The test case is running properly, without any errors, but not working as expected.
It is not creating more than 1 record but still clicking on the debugger button according to the items in the FOR-loop list.
For example, instead of creating 7 new records it creates only 1 record but shows that the debugger button has been clicked 7 times.
Even the record created is empty with no data entered or selected in it, which means that this part of the test case is not working, in the ForAll loop.
Repo steps:
Create a Canvas App form with New/Submit button, text fields/ to enter some data in them.
Add a debugger button to show the count of which iteration the loop ran for (optional)
Create test suite then test case, record a test case of creating and submitting a new record with some fields filled in the form and then submit it.
Create another test case and use a list to initialize it, and then add a ForAll-LOOP to run the number of times according to the list. and perform the actions mentioned above. Then run the test.
For example :
OnTestCaseStart
ClearCollect( Questions, [ "combined question 1", "combined question 2"
, "combined question 3", "combined question 4", "combined question 5","combined question 6" ]);
Step in the TestCase
ForAll(
Questions,
Select('NewRecordAddIcon1')& //worked once
SetProperty('DataCardValue1'.Text, "testingforloop")& //not working at all
Select('Button1')& //working according to the loop
Select('SubmitFormButton1') //worked once
)
Please see attachment for Play Mode result, which says it works fine but actually it's not creating the new records.