How do I parse an HTML response for validation or to extract a value?
Insert a Script following the Message whose response you wish to validate.
Ensure that the Script doesn't play until the Message has completed.
If you are using a Sequenced Test Clip, this will always be the case and there is nothing special to do.
If you are using a Timed Test Clip, then you must either put the Message and the Script together into a Chain or put a Checkpoint between the Message and the Script. You could also insert a Delay between the Message and Script that you know will always be long enough, but this may not be consistently reliable if the response times to your Message vary.
Your script should look something like the following:
Note that your Script could also put the extracted value into a property, insert it into another message, or do anything with that value that a Script can do.
|Here is an example of the Script following the Message in a Chain:|