Automated Test Framework - Change / Approval
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-14-2019 07:27 AM
Scenario:
I have a ATF that I want to test a workflow with.
* Manually to get the steps from the work flow(Following the logic in the workflow), I have filled out the change request and submitted it successfully as a user that would submit a change request.
* Next, I logged in as a user (with approval role based on workflow) and approve the change request.
* When I log on as the Approval user I go to My Approvals and look for the change request that I created. I see the change request in the list of approvals.
* I click on link for the CHGXXXXXX request state of Requested (which takes me to the sysapproval_approver.do form I click the button manually. to approve which causes the CHGXXXXXX request to move to the next spot in the workflow.
What I'm having problems with is getting to My Approvals and opening the correct approval. When I do an Open an Existing record, point it to Approval [sysapproval_approver] Table I have tried to use the Insert contextual value widget I get Step 5: submit a form > Record
The test run fails on this test I get the following error
FAILURE: Failed to open the 'sysapproval_approver' form with id 'a57429411b937300346431dcdd4bcbde'
Table 'sysapproval_approver' does not have a record with id 'a57429411b937300346431dcdd4bcbde'
Which I'm assuming the CHGxxxxxx record and the approval record do not have the same sys_id's or are looking in two seperate places.
Question: How would I use the ATF to go to the My Approvals (sysapproval_approver) area and pull the correct CHG record so I can work with the approval form?
- Labels:
-
Automated Test Framework

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-14-2019 07:35 AM
Hi,
Check out 'Automate Change Request and Approval Process using ATF' in ServiceNow Community.
If my reply helps you at all, I’d really appreciate it if you click the Helpful button and if my reply is the answer you were looking for, it would be awesome if you could click both the Helpful and Accepted Solution buttons.
Regards,
Pratiksha

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2019 03:03 PM
You should be able to use the Record Query step on the Approval table and get the record that has your Change ID from previous step, state of Requested and Approver is the user you are trying to approve with. This step will return the sys_id of the first matching record to your query and you can use it as an input into the Open Form step or any other steps you need it for.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2019 07:46 PM