Quantcast
Channel: [Q&A - FAQ Neotys] Last questions
Viewing all articles
Browse latest Browse all 2283

Example using regex assertion with variable?

$
0
0

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?


Viewing all articles
Browse latest Browse all 2283

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>