Writing a test on an alert from inspecting an element

Hello I am not sure if this is possible or not as I am new to Postman but wanted to check. I am trying to write a test to confirm that a particular audit message on a page displays. I tried to get the audit message to return on a POST request and it does not. So I inspected the element and this is the alert that I want to write a test for:


When I use the response body to test messages its real simple and just use the following (just trying to show that I know how to display page message):

tests[“Request routes to Margin Advanced”] = responseBody.has(“Margin Approval Advanced - Check”);

Does anyone know if there is any javascript code that I can run to create this test? I am currently learning the language on Linkedin Learning so do have some basic knowledge but that is very limited still at this point.

1 Like

:hugs:There are code snippet that will generate test code for you postman test script section , see the response body contains snippet .