@declan_ritchie
To check responses in JMeter for the presence of a canonical link, you can use the Regular Expression Extractor post-processor.
Follow these steps:
If the canonical link is found in the response, the "canonicalLink" variable will contain the value of the "href" attribute of the canonical link tag. If it's not found, the "canonicalLink" variable will be empty.
Note: You may need to adjust the regular expression to match the specific format of the canonical link in your application.
@declan_ritchie
Additionally, you can use the "Response Assertion" listener in JMeter to check for the presence of a canonical link. Here's how to do it:
Add a "Response Assertion" listener as a child of the HTTP request you want to check. In the "Response Assertion" listener, set "Response Field to Test" to "Text Response" and "Contains" to the expression you want to look for, such as "<link rel="canonical"". Save the "Response Assertion" listener and run your test. After the test has run, view the results in the "View Results Tree" listener. Look for failed assertions in the "Assertion Results" tab of the listener. If the canonical link is not found in the response, there will be an assertion failure indicating that the expression was not found.
Using either the Regular Expression Extractor or the Response Assertion listener, you can check if each response contains a canonical link in JMeter.
@declan_ritchie
Yes, absolutely. Using either the Regular Expression Extractor or the Response Assertion listener in JMeter, you can check if each response contains a canonical link.