Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

Reusable tests in service now

BhagyashriS4766
Tera Contributor

I’m trying to build a reusable test in ServiceNow and running into limitations around dynamically setting catalog item variables.

What I want to achieve -Create a reusable ATF test which will

  • Impersonate a user (passed as input parameter)

  • Open a catalog item (passed as input parameter)

  • Set form values dynamically using a JSON input (key-value pairs)

  • Submit/order the catalog item

 

What I tried

BhagyashriS4766_0-1777445028297.png

 

 Problems

  • g_form is not available in server-side steps

  • Not able to fetch the input of reusable test in run server side script.
  • I don’t see a way to execute client-side scripts within a custom ATF step

  • In Custom Step Configuration:

    • Step Environment = UI is not allowed to use .

    • Category = Form is also not allowed to use.

Main Questions

  1. How can I dynamically set catalog item variables in ATF using a JSON input?

  2. Is there any way to execute client-side logic (g_form) within ATF or a custom step?

  3. In a reusable ATF test, how do I access the input variables inside a Run Server Side Script step?

Goal

A reusable ATF test where I can pass:

  • User

  • Catalog Item

  • JSON of variable values

…and the test:

  • Impersonates the user

  • Sets variables dynamically

  • Orders the catalog item


Any guidance, best practices, or sample implementations would be greatly appreciated.

0 REPLIES 0