Ask Your Question
3

What is the method to make the text and background of a cell in a statistics table turn red in JMeter HTML Dashboard Report, if the response time exceeds the threshold value?

asked 2023-03-06 11:00:00 +0000

scrum gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2021-10-02 18:00:00 +0000

pufferfish gravatar image

To make the text and background of a cell in a statistics table turn red in JMeter HTML Dashboard Report, if the response time exceeds the threshold value, follow these steps:

  1. Open your JMeter Test Plan.
  2. Add a Listener that generates the HTML Dashboard Report (like "Generate Dashboard Report").
  3. In the HTML Dashboard Report generation properties, set the threshold value for the response time metric.
  4. Choose the statistics table you want to customize and find the relevant HTML tag that corresponds to the cell that contains the statistic value you want to customize.
  5. Add an "if" condition to the HTML tag that checks whether the statistic value exceeds the threshold value.
  6. If the "if" condition evaluates to "true", add a class to the HTML tag that specifies the red text and background style.
  7. Save the modified HTML template and generate the Dashboard Report again.

Here is an example of the HTML template modification:

<td class="${stat.statErrorPct > ${threshold} ? 'failText' : ''}">
  ${stat.statErrorPct}
</td>

In this example, the "if" condition checks whether the "statErrorPct" statistic value exceeds the "threshold" value set in the Report generation properties. If it does, the class "failText" is added to the HTML tag, which is defined in the CSS stylesheet as having red text and background style:

.failText {
  background-color: red;
  color: white;
}
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-03-06 11:00:00 +0000

Seen: 10 times

Last updated: Oct 02 '21