Highlighted
Frequent Contributor.. Frequent Contributor..
Frequent Contributor..
1020 views

LoadRunner - JAVA over HTTP - Requests/responses in separate external .xml files

Hi...

I am working on recording a java based client application. I am using the Java over HTTP protocol. One of my issues (code below) is that the requests/responses are not in my recorded scripts, but rather are in .xml files in the script's directory. If this data is externally written, how can I validate the data returned in my scripts? There must be a way to access this information so I can know if the script passed or failed. Is there an option to include this data directly in the scripts instead of creating .xml files? And if not, how can I make use of these files?

I'd appreciate any assistance on this matter...

 

 

//////////////////////    requestBody0.xml    //////////////////////
    WebRequest WebRequest0 = (WebRequest) JavaHTTP.readObject(WebRequestBA0);

    WebResponse WebResponse_String0 = (WebResponse) JavaHTTP.sendSerialized(WebRequest0, 0,
    "javaHttpJ.serializers.JavaObjectStreamSerializationProvider",
    "xxxxx",
    "URL=http://xxxx/xxx/xxxx",
    new String[]{
        "Method=POST",
        "Resource=0",
        "RecContentType=text/plain",
        "Referer=",
        "Mode=HTML",
        "EncType=xxx/logon",
        LAST});// 0 is the number of the header file, record time response is at file responseBody0.xml

    _webresult = lrapi.web.add_header("Request-Id",
        "527464523502");

0 Likes
1 Reply
Highlighted
Respected Contributor.
Respected Contributor.

Re: LoadRunner - JAVA over HTTP - Requests/responses in separate external .xml files

Hello,

 There is no other way to generate a script with Java over http protocol and that is how the script will be created, in regards to validate and look the information of request and responses what you may do is:

 Viewing Requests and Responses in XML Format

 For each request and response, you can view the corresponding XML that representsthe binary java

object during the recording phase.

To view requests and responses in XML format:

  1. Locate the target request or response section in the code. Right-click the commented

RequestBodyX.xml or ResponseBodyX.xml.

 Select View XML. The XML is displayed in a separate window

 That was taken from the LoadRunner user guide page 575

 https://admhelp.microfocus.com/lr/en/12.56/help/PDFs/HPE%20LoadRunner%20User%20Guide.pdf

 Thanks

 

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.