- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-14-2019 12:09 PM
Hello,
I am trying to update the record and approve it but I am running into couple problems. I followed this tutorial from servicenow, but it is not working. I am using Kingston btw.
The TL;DR version is, how do you approve a catalog item record. What are the steps for it? The tutorial I linked did not help me.
The long version is below.
What I am trying to do:
In ATF, I want to open a catalog item, set the values, submit it and go through the multiple approval process of the record.
What I did:
First Approach
I created a test file, say Test 1. What I first tried to do in Test 1 is:
- Impersonate (as User 1)
- Open a Catalog Item
- Set Variable Values
- Order Catalog Item <-- Successful up to this point
- Impersonate (as User 2)
- Record Query <-- Failing here saying (1** see below)
- Record Update
Second Approach
I created two test files. One is Test 1 and Test 2.
In Test 1:
- Impersonate (as User 1)
- Open a Catalog Item
- Set Variable Values
- Order Catalog Item
In Test 2:
Before I start Test 2, I go to the table where the record was created from Test 1 and paste into the Replay Request Item as shown in the tutorial in Test 2. It defeats the purpose of Automation if I have to do something manually, but I just want to pass the test, but it still doesn't work.
- Replay Request Item (paste the RITM number I got from the record)
- Impersonate (as User 2)
- Record Query <-- Again, failing here (2** see below)
- Record Update
I have more approvals I need to go through, but for now, I just want only one approval working before I proceed.
Problems I am running into:
1** On my first approach, I am trying to get it approved from sysapproval_approver table. I am trying to find the record using the RITM number, but I get an error saying it couldn't find the record but it shows it was looking using the REQ number and not the RITM number. The condition I put was Approval for | is | Step 4: Order Catalog Item > Request
2** On my second approach, the problem I am running into the same problem as above. The table is same but the condition is a little different. The condition is Approval for | is | Step 1: Replay Request Item > Replayed Request Item > Request and instead of searching the record using the RITM number, it is looking it up using the REQ number.
I did more testing and I was running into more weird problems, but if I mention all that, the post will get really long and I doubt anybody will read it. So my question is, how do you get the record to approve in ATF?
Thanks
Update: Follow up post to this with more questions is here.
Solved! Go to Solution.
- Labels:
-
Automated Test Framework
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-20-2019 11:30 AM
Here is what I would suggest as it working on my side for approval,
- Impersonate (as User 1)
- Open a Catalog Item
- Set Variable Values
- Order Catalog Item
- Record Query -> To get RITM record using Req ID from #4
- Record Validation - > to ensure that RITM exist and the stage is approval
- Record Query - > To get Approval(sys_approval) record using RITM ID from #5
- Impersonate -> impersonate approver to validate
- Open exist form -> To open approval form using Approval ID from #7
- Set Variable Values -> You can select option to Approved.
- UI action/button -> Click Save button to save the form.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-22-2019 06:22 AM
Look like you doing it incorrect on step #5 by using sysapproval_approver table instead of sc_req_item table.
In step #5 you need to get RITM record first,
- Use table called sc_req_item.
- Use conditions: Request is request_id(From step #4). It will look like Step 4: Order Catalog Item > request
Here is screenshot example,
On step #7 is where you can get approval record from sysapproval_approver table by using RITM record from step #5. You need RITM# for conditions, Approval for is RITMXXXXXXXX(use step #5 RITM ID here). Don't use REQ#.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-22-2019 06:46 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-22-2019 07:48 AM
That helped. Thank you. But quick question though. On Step 6, how are you doing the record validation? Whatever I am doing is throwing an error, so everything but that step is working great for me.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-22-2019 08:07 AM
Thanks, that worked.
I have 2 questions about Step 6 on Record Validation. Are you supposed to do that after opening a record or after Record Query? Because I am getting an error saying you didn't open any record so we can't validate it.
Also, to "to ensure that RITM exist and the stage is approval", how do I do that from the previous steps?
BTW, this is how my steps look like:
- Impersonate (as User 1)
- Open a Catalog Item
- Set Variable Values
- Order Catalog Item
- Record Query -> To get RITM record using Req ID from #4
- Record Query - > To get Approval(sys_approval) record using RITM ID from #5
- Impersonate -> impersonate approver to validate
- Open exist form -> To open approval form using Approval ID from #6
- UI action/button -> Click Save button to save the form.
Again, thanks for all the help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-22-2019 08:24 AM
It not necessary to do Record Validation after Record Query but it a good practice for validation and investigate purpose in case it get error.
To do that on Step #6 Record Validation,
- Table = Requested Item(sc_req_item)
- Record = Use Step #5 RITM ID
- Field Values/Conditions = Item is "Name of your catalog item that you just submitted"
- (optional) You can add another field but above is good enough.
There is alternative way to validate RITM form which I prefer this way because of screenshot,
- On Step #6, use Open an Existing Record step. Table is Requested Item and Record is Step #5 RITM ID
- Next step is Field Values Validation step. Item is "Name of your catalog item that you just submitted"
The difference between Record Validation and Field Values Validation,
- Record Validation - Quicker test executing time, Use only 1 step, and no screenshot.
- Field Values Validation - little more test executing time, use 2 steps(First, Open an Exisiting Record step and then Field Values Validation step), and it does screenshot.
I prefer second option because if there is any error in validation step, I can check the failed screenshot to find where exactly the error came from in the form.