- 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-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-22-2020 11:43 AM
Thanks! This may be the answer, but it still doesn't appear to be working. Even though I set sysparm_query to a value as a Query parameter, the test behaves as if it is blank.
I haven't been able to find any documentation for this. Do you know if there is a way to see the URL that is generated from the test step (or what the URL would look like if it had those parameters)?
As an example, I'm trying to set the sysparm_query value in the URL to www.example.com as in the example below:
https://mysite.service-now.com/nav_to.do?uri=%2Fcom.glideapp.servicecatalog_cat_item_view.do%3Fsysparm_id%3D5551234567810d974edf9bc4bcbed%26sysparm_query%3Dwww.example.com%26

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2020 09:06 PM
Hi
This is how you are setting query parameter?
Also make sure this is right query name & value, because i believe sysparm_query is used to filter data like sysparm_query=id!=007
Regards
Deepen shah
aavenir.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2020 12:00 PM
Yes I entered it that way and verified it is the right query name.
I found that in SN on the form for the client-side script that uses the parameters, there is a form field for "UI Type", which I assume specifies on which UI types the script is active. It had the options of Desktop, All, and, Mobile/ServicePortal and it was set to Desktop, so I changed it to Mobile/ServicePortal.
I now get javascript errors on the Service Portal page from the client-side script and will need to fix this.
Do you know why query parameters are not a feature on the "Open a Catalog Item" test step as well?