Regex in check not acting as expected

18 views
Skip to first unread message

Shahenda Khaled

unread,
Jan 22, 2018, 5:29:19 AM1/22/18
to Gatling User Group
Hello, 

I'm checking for a pattern in a ws response like this:

exec(ws("Synchronization process").check(wsAwait.within(300000 seconds).until(1).regex("""completed. (\d*) items""").saveAs("catalogCount")))

and the response is usually something like this: 

Synchronization process for catalog NewCatalog completed. 60 items synchronized in 70 seconds.

And this works as expected and I get '60' in "catalogCount", but, my problem is that when the number of items increases it becomes comma separated like:

Synchronization process for catalog NewCatalog completed. 2,160 items synchronized in 270 seconds.

and the previous regex() doesn't work. I tried regex("""completed. ([[:print:]]+) items""") and regex("""completed. ([[:graph:]]+) items""") but while they work in an online regex tester they're not working in my code.

Many thanks.

Shahenda Khaled

unread,
Jan 23, 2018, 3:44:25 AM1/23/18
to Gatling User Group


Solved it with """completed. (.*?) items"""

Cheers
Reply all
Reply to author
Forward
0 new messages