I am new to JMeter. I have been working as a ServiceNow Tester and have been instructed to learn JMeter for performing performance testing on SerivceNow applications. I have been practicing it on my PDI. I have created a new catalog item that triggers an approval request post Submission and on Approval triggers a catalog task. On Jmeter, I have recorded the test scripts using its record controller. I covered the steps where an end user logs in to the SP portal, navigates to the catalog item, inserts the details and submits the form. I removed the unnecessary samplers (any domain apart from the Google or SNOW PDU domain). Then I ran the recorded scripts using a View Results in Tree listener. I observed that some of the samplers failed. I also see error of ‘unauthorized’ and also ‘no cache’ in the respsonse headers. PFA SS. Please tell me how to overcome these bottlenecks. I am really clueless.
I also see the error of ‘unauthorized’ and also ‘no cache’ in the response headers. In order to troubleshoot,
-
I had added a Cookie Manager to my Test Plan,
-
I added an Authorization Manager put Base URL: http://localhost, Username, password, Mechanism=Basic
-
Added Beanshell Preprocessor with the script:
import org.apache.commons.codec.binary.Base64; String username = vars.get("USERNAME"); String password = vars.get("PASSWORD"); String combineduserpass = username + ":" + password; byte[] encodedUsernamePassword = Base64.encodeBase64(combineduserpass.getBytes()); vars.put("base64HeaderValue",new String(encodedUsernamePassword));
-
Added Header Manager with the following headers:
Authorization Basic ${base64HeaderValue}
Content-Type application/json
Still I am getting Unauthorized error.
ankita dutta is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.