Making ATF for problem record with state closed, failing at final step

snow_beginner
Mega Guru

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.

1 ACCEPTED SOLUTION

Hi @snow_beginner 

 

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

View solution in original post

5 REPLIES 5

Shaqeel
Mega Sage

Hi @snow_beginner 

 

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

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.

Hi @snow_beginner 

 

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

Hi @Shaqeel thanks, that has resolved the issue.