Unanswered question

Example using regex assertion with variable?

I have a response containing this:

<input id="FirstName" type="text" value="Fred"/>

When I assert the following regex:

<input.*?"FirstName".*?value="Fred".*?/>

the assertion passes. But when I use a variable in the regex instead of the literal value:

<input.*?"FirstName".*?value="${NewFirstName}".*?/>

The assertion fails. I've confirmed I have the variable populated by outputting it with Javascript before the request with the assertion. I've also tried escaping the $ and { as \$\{ and \\$\\{ but it still fails. Can someone provide an example that should work?

Michael M.
Michael M.

Michael M.

Level
0
52 / 100
points

No answers