ATF: Parameterized tests - is it possible to change assert type based on parameter values?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2022 04:16 AM
Hello, all! I have a question regarding parameterized testing in ATF and I have not been able to find this info, so I am hoping someone out there can help.
I need to build some tests to validate the access of different roles to records in a custom table. I'll give you a simple example:
Test A - Create a new record in table XYZ
- role '123' is able to create new records
- role '456' is not able to create new records
I created Test A as a parameterized test, with one parameter - the user role. I then created 2 data sets: one for role '123' and another one for role '456'. My problem is that it does not seem possible to use the same test to assert the 2 different scenarios:
- Test A step 1: create and impersonate user with the role that is in the parameter value
- Test A step 2: assert that the record was created --> the record is only created for role '123'; when the test runs for the second parameter, role '456', it fails
Is there some way to change the assert type so that it validates that the record was created for role '123', but then validates that it was NOT created for role '456'?
My solution for now is to duplicate these tests so each one has a different assert, but this seems cumbersome and generates a lot of repeated steps and extra work (even though I am using templates, it feels like there should be a better way to accomplish this).
Thanks in advance 🙂
- Labels:
-
Automated Test Framework

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-20-2023 09:56 AM
Hi Shan
Since Custom UI is not supported natively, I have not tried it yet. Are you looking for information on how to access the output variable in the script section? You can try the following way:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-20-2023 10:03 AM
Thanks Ankush.
Yes, I have tried those but no luck. Please check this post and share if you think any possibilities.