Hello, 

I want to parse an html <table>'s content, and create an HTTP request on
each of its <tr> elements. The Http request will use some <td> element's
content as its parameter, according to predefined rules. So I used a regex
to capture a <td>'s content as a group, on these <tr>. 

(I did not use XPath because I'm not sure if the initial html <table> and
the page that contains it are well-formed.)

This is my regular expression (say that I have only two cells in each wanted
tr. The cell's class must be  "tgDataColumn", and I want to capture their
content):

<TD
class=(?:\"tgDataColumn\"|tgDataColumn)(?:.*index=[\d+]\'\">)(.*)</TD>\n<TD
class=(?:\"tgDataColumn\"|tgDataColumn)(?:.*index=[\d+]\'\">)(.*)</TD>\n 



I will use it to capture all occurrences (all <tr> that contains
"class=tgDataColumn" or "class="tgDataColumn"") in a HTML, then, in a
foreach controller whose "Input variable prefix" is set to "myRef" (the
"Reference Name" of my regex extrazctor), I want to reference to variables
created by regex, with:
"myRef_n_gm" syntax. I created a Http sampler, that uses each group
${myRef_n_gm}'s value  as a parameter.

However under my foreach controller, I'm unable to find these myRef_n_gm
variables' value, and at last they are represented like literals:
"${myRef_n_g0}", "${myRef_n_g1}", etc...

The only thing I can do is capture the td's content and write it into a
template of regex extractor - A=$1$&B=$2$, then use the concatenated
template value  (like "A=xx&B=yy") as a whole, in my foreach controller.


What did I miss?


-- 
View this message in context: 
http://old.nabble.com/problem-in-reading-variable-set-by-capturing-groups-in-regex-with-%22Match-No.%22-set-to-negative-tp26475373p26475373.html
Sent from the JMeter - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to