- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2024 03:12 AM
Hi,
I have a requirement to make an ATF for problem record where state=closed.
The logic is to have a non-admin user find a problem record where state=closed and then try to change its mandatory fields like Impact, Urgency etc and save it. The result is that it should not be possible. However, with this logic the last step always fails (which is exactly the correct outcome) but...the ATF should not fail...if that makes sense. Is there a way to put some logic in, where the ATF passes because it is unable to update any of the mandatory fields?
ATF test steps:
1) create a user - with role itil and snc_internal
2) impersonate the above user
3) Record Query - to the problem table where state=closed
4) Update record - update the record from step 3 with setting impact-medium, urgency-medium etc
The expected outcome is that this should not be possible on a closed problem record, however then the ATF will always fail on step 4 and as long as it fails its a good thing but I can't really have ATF failing.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2024 01:27 AM
You need to open the form first before validation the fields.
If you are using record query after this, use Open existing record and dot walk to record query step.
Then you can perform the fields validations
Mark helpful/Solution.
Regards
Shaqeel
***********************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting "Accept as Solution" and " Helpful." This action benefits both the community and me.
***********************************************************************************************************************
Regards
Shaqeel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2024 09:52 AM
If the state is closed, then the fields should be read-only?
If yes you can use field state validation,
Regards
Shaqeel
***********************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting "Accept as Solution" and " Helpful." This action benefits both the community and me.
***********************************************************************************************************************
Regards
Shaqeel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2024 02:04 AM
Hi @Shaqeel thats a good idea and I have tried that now, but now I am getting this error - FAILURE: Unable to perform field state validation because g_form is not defined. A valid form must be open before running assertions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2024 01:27 AM
You need to open the form first before validation the fields.
If you are using record query after this, use Open existing record and dot walk to record query step.
Then you can perform the fields validations
Mark helpful/Solution.
Regards
Shaqeel
***********************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting "Accept as Solution" and " Helpful." This action benefits both the community and me.
***********************************************************************************************************************
Regards
Shaqeel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2024 01:36 AM
Hi @Shaqeel thanks, that has resolved the issue.