0
votes

while executing Ajax request in Jmeter script, it is failing with below error. please help me how to handle ajax request.

url/BOE/portal/${portal_id_g0}/InfoViewAppActions/ajaxUre/ajaxRequest

Sample Result: Thread Name: Thread Group 1-1 Sample Start: 2019-11-27 14:33:18 GMT Load time: 30 Connect Time: 0 Latency: 30 Size in bytes: 1683 Sent bytes:0 Headers size in bytes: 404 Body size in bytes: 1279 Sample Count: 1 Error Count: 1 Data type ("text"|"bin"|""): text Response code: 403 Response message: HTTP/1.1 403

HTTPSampleResult fields: ContentType: text/html;charset=ISO-8859-1 DataEncoding: ISO-8859-1

RESPONSE DATA: HTTP Status 403 ? Forbiddenh1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} h2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} h3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} body {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} b {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} p {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;} a {color:black;} a.name {color:black;} .line {height:1px;background-color:#525D76;border:none;}

HTTP Status 403 ? Forbidden

Type Status Report

Message ???boetrustguard.TokenCreationFailed???[/BOE/portal/1908281108/InfoViewAppActions/ajaxUre/ajaxRequest] ???boetrustguard.TokenCreationFailedValue??? [MDAwRGxVXj8PLRGxgQTY0R29QVmRAMD01RDtMUlllNTAEQ] ???boetrustguard.TokenCreationFailedMessage???[???boetrustguard.token.missing???]

Description The server understood the request but refuses to authorize it.

Apache Tomcat/8.5.13

1

1 Answers

0
votes

Looking into Dashboard SAP Analytics BI Load testing > Introduction to Apache JMeter > Additional considerations: Static vs. Dynamic Content:

There is at least one dynamic parameter called bttoken which needs to be correlated:

  1. Extracted from the previous response using a suitable JMeter's PostProcessor
  2. Recorded hard-coded value needs to be replaced with the JMeter Variable from step 1

Given you will be able to extract the bttoken and properly add it to your AJAX request it should start working normally.

Also be aware that AJAX requests have asynchronous parallel nature so if there is > 1 AJAX request in scope it's better to put them under Parallel Controller - this way you will get the same behaviour as the real browser.