ATF Test Failing with List Collector

ap18
Kilo Contributor

I have a Service Catalog Item for which I am trying to create an ATF test. These are my test steps. 

1. Open a catalog item 

2. Set variable values

3. Validate variable values

4. Add item to shopping cart

5. Order catalog item

My results show I am failing at Step 3. However, when watch the test execute, I noticed I am failing at step 2. My catalog item asks the user for a vendor and then the following question asks what the user wants to order from the vendor. The list collectors utilizes Reference Qualifier and ref_qual_elements to change what products are shown depending on the vendor selected. For example, if I have Vendor A and Vendor B, and I select Vendor A, the list collector will only show me the 10 products offered by Vendor A. While I watch the test run, I noticed that after the vendor selection changes, the products offered in the list collector change, but the selection I made in "set variable values" is moved to right "selected" side of the list collector. And then, the test proceeds to fail at step 3. To check that my issue is happening at Step 2, I changed Step 3 from active=true to active=false, and then my test failed at "Add item to shopping cart".

How can I resolve this issue? 

1 ACCEPTED SOLUTION

LaurentChicoine
Tera Guru

I did not check on the latest version, but I remember having to use Service Portal Catalog ATF instead of Platform Catalog ATF to be able to test forms with a list collector variable.

If it is applicable to your use case it might be worth it to do your ATF on the Service Portal view of your catalog item (with the associated step configurations specific to the Service Portal).

View solution in original post

2 REPLIES 2

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

Why not use Order catalog item directly?

Set the property glide.sc.sp.twostep to true to fix the issue

Alternatively, Adding a Time out of 5 sec to the Ordering Steps also resolves the issue.

please check below link

https://community.servicenow.com/community?id=community_question&sys_id=58cb90a2dbf9bb80a39a0b55ca96...

If my answer solved your issue, please mark my answer as Correct & 👍Helpful based on the Impact.

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

LaurentChicoine
Tera Guru

I did not check on the latest version, but I remember having to use Service Portal Catalog ATF instead of Platform Catalog ATF to be able to test forms with a list collector variable.

If it is applicable to your use case it might be worth it to do your ATF on the Service Portal view of your catalog item (with the associated step configurations specific to the Service Portal).