- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2018 03:06 PM
I'm encountering some strange errors using the Automated Test Framework. On certain client-side test steps, I keep getting this error: “This step failed because a client-side Javascript error was detected on the page being tested. See the logs and screenshots on the test result for details.” It happens intermittently on several different test steps, including some steps that open existing records, some that click UI Actions, and some that set field values. I've seen the same error on some tests I did on records in kb_knowledge, others on sysapproval_approver.
The log and screenshot are entirely unhelpful, but a ServiceNow document about this error instructs me to inspect the console in my browser, where I found this:
Uncaught ReferenceError: g_form is not defined
at VM1338 js_includes_form_presence.jsx?v=03-30-2018_1938&lp=Mon_May_21_09_09_16_PDT_2018&c=23_348:318
at Object.invoke (VM1335 js_includes_ui16_form.jsx?v=03-30-2018_1938&lp=Mon_May_21_09_09_16_PDT_2018&c=23_348:45)
at VM1335 js_includes_ui16_form.jsx?v=03-30-2018_1938&lp=Mon_May_21_09_09_16_PDT_2018&c=23_348:46
at q (VM1335 js_includes_ui16_form.jsx?v=03-30-2018_1938&lp=Mon_May_21_09_09_16_PDT_2018&c=23_348:10)
at fb (VM1335 js_includes_ui16_form.jsx?v=03-30-2018_1938&lp=Mon_May_21_09_09_16_PDT_2018&c=23_348:46)
at c (VM1335 js_includes_ui16_form.jsx?v=03-30-2018_1938&lp=Mon_May_21_09_09_16_PDT_2018&c=23_348:24)
at Object.Gc [as bootstrap] (VM1335 js_includes_ui16_form.jsx?v=03-30-2018_1938&lp=Mon_May_21_09_09_16_PDT_2018&c=23_348:24)
at Object.bootstrap (VM1315 js_includes_last_doctype.jsx?v=03-30-2018_1938&lp=Mon_May_21_09_09_16_PDT_2018&c=23_348:7449)
at initAngularForm (VM2127 kb_knowledge.do?sys_id=eee6f93…&sysparm_atf_debug=true&sysparm_atf_s…:452)
at VM1349 z_last_include.js?v=2:5
The above-mentioned document tells me to fix the error myself (the article assumes I've got a bug in one of my own client scripts or something), but I don't think this is an error I can fix myself. I traced the error to some code that appears to be related to presence and those little blue inline record update indicators. (See attachments for more detail.)
Help?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2018 07:17 PM
Hey
According to the info I got at the meetup re ATF I think you are stuck with this. They said "Many UI Test failures are the result of errors logged in the console • These are often very difficult to diagnose and fix • They are the source of many Known Errors (eg, the Approval form) ..."
ServiceNow are planning on including a Whitelist for client errors where you will be able to either ignore the error or show a warning (but still not fail).
So if it is an error that you have no control over you'll have to miss that as a test for now, no way of working around it as far as I know...
Regards
Bonnie

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2018 07:17 PM
Hey
According to the info I got at the meetup re ATF I think you are stuck with this. They said "Many UI Test failures are the result of errors logged in the console • These are often very difficult to diagnose and fix • They are the source of many Known Errors (eg, the Approval form) ..."
ServiceNow are planning on including a Whitelist for client errors where you will be able to either ignore the error or show a warning (but still not fail).
So if it is an error that you have no control over you'll have to miss that as a test for now, no way of working around it as far as I know...
Regards
Bonnie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2018 08:23 PM
Ooh, thanks so much for the info, Bonnie. Whitelists would be great for this. I looked it up and sure enough that's supposed to be coming in London. Now I'm going to be impatient for that, haha. In the meantime, through trial and error I noticed that if I leave the test runner tab in the background, the test runs slower (most modern browsers throttle backgrounded tabs) but the errors seem to happen less frequently. It's a pain, but I'll deal with this until I can get my hands on London or Madrid. Cheers!