How to use ATF to test failure

txag08
Tera Contributor

I'm trying to use ATF to test a client script that removes a choice from a choice list for certain users.

Essentially, I want to use the Set Field Values step in the Form category. I impersonate a user who can't see the choice and then tell the Set Field Values step to select that choice. The step will fail, but it's supposed to fail. How can I tell ATF that it's good for a step to fail and that the test should pass?

Can I make a step configuration for forms and do a work around that way?

1 ACCEPTED SOLUTION

ARG645
Tera Guru

I am afraid its not possible. If ServiceNow would have allowed us to crate Custom Step Configuration for UI, we could have created some thing like "test failure for Set Value". But as of now, there is no way around to configure failures into a Green Signal. 

-Really disappointing, there are many areas where ATF finds itself weak, for example: I have AJAX calls on the form that populate few fields on load, and ATF doesnt wait for the Ajax calls to finish and the fields dont get populated. 

Thank you,

Aman Gurram

is your question answered ? if its not answered then please let us know your additional questions.
If it is answered, then please close this thread by marking the appropriate answer as Correct. This way others might find this thread helpful in future. Also, please mark the appropriate answers as Helpful if applicable.

View solution in original post

5 REPLIES 5

Alberto Consonn
ServiceNow Employee
ServiceNow Employee

Hi,

have a look at this article, try the suggested Workaround, it might help to fit your need!

Automated Test Framework error: "This step failed because a client-side Javascript error was detecte...

If I have answered your question, please mark my response as correct so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list.

Thank you

Cheers
Alberto

This is not related to the question I asked.

ARG645
Tera Guru

I am afraid its not possible. If ServiceNow would have allowed us to crate Custom Step Configuration for UI, we could have created some thing like "test failure for Set Value". But as of now, there is no way around to configure failures into a Green Signal. 

-Really disappointing, there are many areas where ATF finds itself weak, for example: I have AJAX calls on the form that populate few fields on load, and ATF doesnt wait for the Ajax calls to finish and the fields dont get populated. 

Thank you,

Aman Gurram

is your question answered ? if its not answered then please let us know your additional questions.
If it is answered, then please close this thread by marking the appropriate answer as Correct. This way others might find this thread helpful in future. Also, please mark the appropriate answers as Helpful if applicable.

txag08
Tera Contributor

Thanks, I was afraid this would be the answer. As it is, the form testing really does not do much at all.