Automated Testing Framework: This step failed because a client-side Javascript error was detected on the page being tested

LMR
Mega Expert

I am currently making a Automated Test that tests the Incident Application. My test is failing when I instruct the test to click the Assign to Me UI Action. After a series of steps that created the Incident record, and populated certain fields, as well as impersonating a Fulfiller, I used the Test Step UI Action Visibility and the test passed. I then created the Click a UI Action Test Step, ran the test, and it failed. I proceeded to look at the Test Results Test Log and saw this:

find_real_file.png

I then went to the screenshots the the ATF provided and noticed something odd...

find_real_file.png

The ATF apparently clicked the Assign to Me UI Action. I know this because:

        1. I have a Business Rule that sets the Incident State field when the Assign to Me UI Action is clicked and the           Assigned To field is populated.

        2. The Incident State field is now Active and no longer New.

        3. The Assigned To field is populated with the ITIL Fulfiller that I instructed the ATF to impersonate.

I'm kind of confused as to why this test is failing, while in the Client Test Runner I'm watching it do as I ask. I am also unsure as to why the Uncaught ReferenceError: current is not defined error is generating as well.

13 REPLIES 13

//function assnToMeFormAction() {



  // gsftSubmit(null,g_form.getFormElement(),'AssnToMeAction');


  //}


  if(gs.getUser().isMemberOf(current.assignment_group)){


  current.assigned_to = gs.getUserID();


  current.incident_state=2;


  current.update();


  action.setRedirectURL(current);


  }



  else{


  gs.addInfoMessage('You are not a memeber of the current Assignment Group');


  current.setAbortAction(true);


  }


It looks like your UI action used to be a client side action.



Are you sure that the 'client' flag is no longer ticked?


That would explain the error.



Also you have a typo



  gs.addInfoMessage('You are not a memeber of the current Assignment Group');



ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022

I will look into the client flag immediately. And thank you for catching that typo. I will notify my Client of that.


I went into the Assign to Me UI Action record and the Client check box was not selected. I selected it, and then ran my test. Instead of it failing at the Fulfiller's stage (Test Step 13 in my test), it failed at the beginning where I used the Test Step Open a New Form (Test Step 2). Now, later down the line in my test I use the Test Step Click UI Action to click 2 other UI Actions on the Incident form (1 specific to the Incident table and the other global), and those Test Steps pass! I went into the UI Action record that was specific to the Incident record and saw this:


find_real_file.png


I checked these same boxes in the Assign to Me UI Action and the test still failed at Test Step 2. I even went as far as to check the couple of different combination of check boxes (between Client, List v2 Compatible, and List v3 Compatible). The test still failed at Test Step 2.


arpitatambi
Kilo Contributor

I am seeing similar error on my machine


Capture.PNGCapture.PNG