Automated Test Framework (ATF) throws errors when reference Ajax Call

Marvin18
Mega Guru
Mega Guru

Hey there,

 

I am currently stuck in using the Automated Test Framework. Our Test case fail due to the error "This step failed because the client error 'TypeError: this is null' was detected on the page being tested. See failing Test Logs. To ignore these errors in the next test run, use 'Add all client errors to warning/ignored list' links."

 

In our research we elaborated, that the problem might pop up because there is a failure in our variable set, which leads to the client-fail. That's why I want to ensure that the programming code of our consulting partner is best practice/right approach.

In the current environment, we are using a variable set, which includes a reference field. This reference field is filled dynamically by using an AJAX call. When the getXML call comes, it throws errors:

 

function onLoad_sysidfromfunctioncall() {

    //Type appropriate comment here, and begin script below
    var ga = new GlideAjax('name_of_script_include_to_get_user');
    ga.addParam('sysparm_name', 'getUserFields');
    ga.addParam('sysparm_user_id', g_user.userID);
	ga.getXML(getData);
}

 

Sure, it is possible to disable the error logs for the client call. But I think it is very beneficial for our company to let this property active, so that real Client side fails can be identified by the ATF.

 

I am very thankful for every hint. If you need any more information, please let me know.

 

Best regards

Marvin

4 REPLIES 4

Ankur Bawiskar
Tera Patron
Tera Patron

@Marvin18 

Does it run when you add that error in ignore/warning list?

are you getting similar browser console error when you test in portal?

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

Hey @Ankur Bawiskar

thank you so much for your quick answer. We do not get the similar error by replicating the test case manually in portal. 

When we use the error in ignore/warning list, the step is not raising the problem anymore and the test can finish positively. 

As we don't want to add that error in ignore list, we want to know, what occures this error.

 

Thank you so much for your quick answer.

 Best regards

Marvin

@Marvin18 

there are many errors which show up only during ATF execution only so I don't think you can easily figure that out

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

Shaqeel
Mega Sage

Hi @Marvin18 

 

The reason these client errors comes up because your system couldn't find this action on the page which is opened. So, it shows this. Even if you add these in error list it won't work as every time it gives you error with different ID hence it doesn't work.

Please make sure the step you use is the valid step and it is visible on the screen.

Please share what is the step you are using then I might help more on this.

 

 

You can always add these error to ignore list.

How to use the Client Error Inclusion list in the Automated Test Framework - Support and Troubleshoo...

 

Regards

Shaqqel


***********************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting "Accept as Solution" and " Helpful." This action benefits both the community and me.

***********************************************************************************************************************





Regards

Shaqeel