question

tomfan avatar image
tomfan asked Philip.Joung edited

Pattern based response map: Making token with regular expression doesn't work

Anyone can have a look at my response map with STC automation?

The regular expression (.+//\w+/\w+) can work but if I use (.+//\w+/\w+)|(N/A) it doesn't work.

Thanks!

puts-detailed-stream-results.ffrm

Spirent TestCenter (STC)response mapautomation
10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

JeffJ avatar image
JeffJ answered tomfan commented

I've taken a quick look at this and it doesn't appear that your regex is the issue. If you look further down the row, you'll find that Avg Latency, Min Latency, and Max Latency are the real issues. The regex for those columns are ([\d]+(\.[\d]+)) which doesn't work when the results are 0. You may want to consider changing it to ([\d]+(\.[\d]+)*).

There may be other issues but this one jumped out to me.

1 comment
10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

tomfan avatar image tomfan commented ·

Thanks Jeff, that's the point, solved!

0 Likes 0 ·
JeffJ avatar image
JeffJ answered tomfan commented

One question I would ask is why you are creating the response map. When using the iTest STC session, these response should come back already response mapped. Is there a breakdown of data that you'd prefer that iTest is not providing?

1 comment
10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

tomfan avatar image tomfan commented ·

Yes, it's already come with mapped response and I can create an empty response map and create my own query from there. I need to run the query for many times with different input parameters. The problem is I only can run the STC command once (coz the response will change if you run the command for more than one time). So I store the response to a variable called "detailed_stream_results". Then I use "puts $detailed_stream_results" and create a dedicated response map for this puts command. I can define query here and wrap the puts command into any loop. It's more flexible.

It would be great If iTest could automatically map the puts command (because the response is exactly same with the STC command) with built-in response map.

Not sure if I explained it clearly.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.