Fetching the data from javascript code

22 views
Skip to first unread message

Aleksandar Djurendic

unread,
Sep 21, 2017, 8:00:54 PM9/21/17
to Gatling User Group
Hello,
Does anybody know, can I get the value 147 from code depicted below:

<script type="text/javascript">
    abc.lr.loanactivation.getHtmlFieldPrefix = function () {
        var htmlFieldPrefix = '';
         htmlFieldPrefix = 'abc_lr_loanactivation';
        return htmlFieldPrefix;
    }
  
    abc.lr.loanactivation.iseditable = '1';
    abc.lr.loanactivation.nextID = '147'
 
</script>

Nige

unread,
Sep 21, 2017, 9:27:31 PM9/21/17
to Gatling User Group
How about:

.check(regex("""abc\.lr\.loanactivation\.nextID = '(.+?)'""").find.saveAs("nextId"))

?

Aleksandar Djurendic

unread,
Sep 27, 2017, 5:00:29 AM9/27/17
to gat...@googlegroups.com
It works!!
Thank you very much!!!

--
You received this message because you are subscribed to a topic in the Google Groups "Gatling User Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/gatling/OBagMtGyQQs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to gatling+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages