1. SPEForums need your contributions to build up a strong repository of performance engineering resources.

    Dismiss Notice
Dismiss Notice
Hello Guest,

Please reach out to us at anmldubey@gmail.com in case you face any issues with SPEForums. Share your feedback - Click Here

Please support us by sharing performance engineering tutorials/resources with SPEForums.com

-Crew

The Correlation Challange

Discussion in 'HP Loadrunner' started by admin, Oct 13, 2016.

  1. admin

    admin Administrator
    Staff Member

    Joined:
    Aug 13, 2014
    Messages:
    134
    Likes Received:
    2
    We will be posting some real life correlation problems for users to crack.

    Problem Statement 1:

    Want to pick up a random code value, where status is LOP Available. See in red below.

    Note -there are two code values and we need to pick up first value.

    Server Response:

    [{"code":"9080000469","creationTime":"Oct 5, 2016","channel":"HYB","childDocuments":[{"code":"0300003445","creationTime":"Oct 5, 2016","channel":null,"childDocuments":null,"type":"MRA","creationDate":1475640000000,"closedTime":null,"refNum":null,"closedDate":null,"closed":false,"refNumString":null,"documentId":"0300003445","status":null}],"type":"General Returns","creationDate":1475690763000,"closedTime":null,"refNum":"satest1","closedDate":null,"closed":false,"refNumString":"Reference #:satest1","documentId":null,"status":"LOP Available"},{"code":"9080000467","creationTime":"Oct 5, 2016","channel":"HYB","childDocuments":[{"code":"0300003393","creationTime":"Oct 5, 2016","channel":null,"childDocuments":null,"type":"MRA","creationDate":1475640000000,"closedTime":null,"refNum":null,"closedDate":null,"closed":false,"refNumString":null,"documentId":"0300003393","status":null}],"type":"General Returns","creationDate":1475689091000,"closedTime":null,"refNum":"saeditreturn","closedDate":null,"closed":false,"refNumString":"Reference #:saeditreturn","documentId":null,"status":"LOP Available"},{"code":"9080000466","creationTime":"Oct 5, 2016","channel":"HYB","childDocuments":[{"code":"0300003317","creationTime":"Oct 5, 2016","channel":null,"childDocuments":null,"type":"MRA","creationDate":1475640000000,"closedTime":null,"refNum":null,"closedDate":null,"closed":false,"refNumString":null,"documentId":"0300003317","status":null}],"type":"General Returns","creationDate":1475688618000,"closedTime":null,"refNum":"satest1","closedDate":null,"closed":false,"refNumString":"Reference #:satest1","documentId":null,"status":"LOP Available"},{"code":"9060200476","creationTime":"Mar 18, 2016","channel":"MANU","childDocuments":[{"code":"0036121459","creationTime":"Mar 18, 2016","channel":null,"childDocuments":null,"type":"Submitted","creationDate":1458273600000,"closedTime":null,"refNum":null,"closedDate":null,"closed":false,"refNumString":null,"documentId":"0036121459","status":null},{"code":"0036121459","creationTime":"Mar 24, 2016","channel":null,"childDocuments":null,"type":"Submitted","creationDate":1458792000000,"closedTime":null,"refNum":null,"closedDate":null,"closed":false,"refNumString":null,"documentId":"0575258799","status":null}],"type":"General Returns","creationDate":1458325703000,"closedTime":null,"refNum":"","closedDate":null,"closed":false,"refNumString":"Reference #:","documentId":null,"status":"Submitted"},{"code":"9003261877","creationTime":"Mar 17, 2016","channel":"CPTP","childDocuments":[{"code":"0036116318","creationTime":"Mar 17, 2016","channel":null,"childDocuments":null,"type":"Submitted","creationDate":1458187200000,"closedTime":null,"refNum":null,"closedDate":null,"closed":false,"refNumString":null,"documentId":"0036116318","status":null},{"code":"0036116318","creationTime":"Mar 23, 2016","channel":null,"childDocuments":null,"type":"Submitted","creationDate":1458705600000,"closedTime":null,"refNum":null,"closedDate":null,"closed":false,"refNumString":null,"documentId":"0575251783","status":null}],"type":"General Returns","creationDate":1458234813000,"closedTime":null,"refNum":"20160317","closedDate":null,"closed":false,"refNumString":"Reference #:20160317","documentId":null,"status":"Submitted"}
     
  2. Rajesh Swarnkar

    Rajesh Swarnkar New Member

    Joined:
    Oct 13, 2016
    Messages:
    1
    Likes Received:
    1
    The first code value can be picked up by using a capture regex with lazy matcher.

    code":"(\d{10})".*?(?="status":"LOP Available"\})

    This will select the 10-digit code if text contains LOP as available.
     

Share This Page