Reputation: 21
is it possible to wait for XPath or CSS selector to display in Jmeter?
I am using HTTP request to send API call and I have assertion as CSS selector path but due to API slowness , I would like to implement a waitfor method for the specific element in UI.
Upvotes: 0
Views: 168
Reputation: 168157
JMeter doesn't execute any Post-Processors or Assertions or Listeners until it gets response from the server therefore you don't need to do anything. See Execution order user manual chapter for more details.
However if I misunderstood your requirement and you want to repeat a HTTP request until XPath or CSS extractor return the value you're looking for you can put the request under the While Controller and put the condition of your choice there:
In the above case:
${myVariable}
doesn't have any value (CSS Selector Extractor hasn't been executed yet)${myVariable}
has value of foo
which doesn't match While Controller's condition so it loops over${myVariable}
value becomes bar
and the While Controller exits the loop.Just in case, textual representation of the jexl3() function used to compare variable with some value:
${__jexl3("${myVariable}" != "bar",)}
Upvotes: 1