- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2020 10:35 AM
I'm testing a SN catalog item. When a user gets directed to the SN form from another website, some parameters are passed through the URL and used to auto-populate the form. One of these parameters is the user's IP address, which is used to populate a field (and made invisible to the user) with a client side script:
var gUrl = new GlideURL();
gUrl.setFromCurrent();
var publicip = gUrl.getParam("sysparm_pip");
g_form.setValue('user_ip_address', publicip);
g_form.setDisabled('user_ip_address', true);
In an ATF test step, how would I set the url parameters for subsequent test steps so that I can validate that this field was populated automatically in the form?
Solved! Go to Solution.
- Labels:
-
Service Catalog

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2020 09:04 PM
Hello Cecilia,
Which ATF test step are you using? If you are using 'Open a Catalog Item (SP)' then it has Query parameters field to supply the parameter.
Regards
Deepen shah
aavenir.com

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2020 09:24 PM
I do not know exactly why 'Open a Catalog Item' step do not have query, but i think because this step is for platform where everything is taken care by SN hence only thing you can provide is 'View'.
Opening in Service Portal here is you've some customization and you might want to control it through query parameter.
Regards
Deepen shah
aavenir.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2020 10:16 PM
Hi,
since those variables are auto-populated when the form loads you can use this steps
1) open catalog item
2) validate variable value
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2020 09:57 AM
The problem is that the IP address isn't populated when I open the form from servicenow. URL parameters are passed when a client is linked to the Service Now catalog item from another domain. I'm trying to simulate those parameters and am wondering if it is possible with ATF.
Thanks,
Cecilia
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2020 01:53 AM
Hi,
I believe anything outside of ServiceNow cannot be tested using ATF.
Since in your case user has a particular link and when that link is clicked user is taken to catalog item form of ServiceNow and then the variables are auto-populated; I believe it cannot be simulated.
Any ATF test step which has to be tested needs to be initiated within ServiceNow.
ATF allows you to create custom steps only for Server Side configurations.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2020 05:45 AM
Hi
You can not interact with any page outside of servicenow.
But what you can do is open catalog item and provide same URL parameter with some value and see if the auto populated value is same.
For e.g.
1. Open Catalog Item with URL parameter (ip=ipvalue)
2. Verify text(ipvalue) on the page.
By assuming this URL parameter (which is actually going to be provide by page in another domain) at least you can make sure that catalog field is using URL parameter
Regards
Deepen shah
aavenir.com