Highlighted
Absent Member.. Absent Member..
Absent Member..
101 views

Getting ACCESS_VIOLATION after web_custom_request, suspect web_reg_save_param_xpath

Jump to solution

I posted this to the Loadrunner Support Forum, and then realized I should have posted it here.  

 

I'm trying to come up with a workaround for a problem we're having with lr_xml_extract( get garbage added to the end of the result string) , and am trying to use web_reg_save_param_xpath to do it.  However, the first time I make the call, I get an ACCESS_VIOLATION.  The query string provided to the web_reg_save_param_xpath does not exist in the response from the server, so I suspected that might be the issue.  I changed the query string to match an element in the response, ran it again, and it worked.

 

So, my question is, how do I deal with the possibility that the repsonse may not have the query string in it?  

 

Here's the web_reg_save_param_xpath call:

 

     web_reg_save_param_xpath("ParamName=workItem",
                             "QueryString=/tcAJAXGetInboxResponse/transaction",
                             "SelectAll=yes",
                             "ReturnXML=yes",
                             "NotFound=warning",
                             LAST);

 

I thought that the "NotFound=warning" would handle the situation where the string wasn't present.  I've got code later on that checks how many items were returned:

 

         workInbox = atoi(lr_eval_string("{workItem_count}"));

 

Obviously, I'm missing something.

 

Any suggestions?

 

Marc Robertson

 

1 Solution

Accepted Solutions
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Hi Mrobertson,

 

The expected behavior is the function to return an error message not an exception. The issue is reproducible in LR 11.52.

Please open an a case with support the issue to be investigated in more details.

 

The workarounds at the moment are:

1. to be sure the  query string matches an element in the response

2. If you comment "ReturnXML=yes" you will received an error message. It will be useful if you only need to count how many elements were found.  

3. The third option will be to use other correlation function.

 

Kind regards,

HPE Support
If you haven’t tried it yet, come and join us in our entitled forums at Support Customer Forums

If you find that this or any post resolves your issue, please be sure to mark it as an accepted solution and give Kudos to the author for their assistance.

View solution in original post

0 Likes
1 Reply
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Hi Mrobertson,

 

The expected behavior is the function to return an error message not an exception. The issue is reproducible in LR 11.52.

Please open an a case with support the issue to be investigated in more details.

 

The workarounds at the moment are:

1. to be sure the  query string matches an element in the response

2. If you comment "ReturnXML=yes" you will received an error message. It will be useful if you only need to count how many elements were found.  

3. The third option will be to use other correlation function.

 

Kind regards,

HPE Support
If you haven’t tried it yet, come and join us in our entitled forums at Support Customer Forums

If you find that this or any post resolves your issue, please be sure to mark it as an accepted solution and give Kudos to the author for their assistance.

View solution in original post

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.