Quantcast
Viewing all articles
Browse latest Browse all 12134

Re: unable to replay Java Over HTTP

Thanks madan for you reply ,

 

I'm doing performance testing for mobile application which is developed in java language and coming to load runner scripting i'm using java over HTTP as protocol.

Actually i'm not aware of this protocol,i can able to record the application but i don't know whether all the requests got captured or not.

Note:In java over HTTP protocol no generation log and no run time viewer to validate the requests .So how can we validate?

 

Find below the sample script for your reference(I think the request is in binary data format it is not understand by the server).

 

import com.thoughtworks.xstream.*;
import java.io.*;
import javaHttpJ.*;
import javaHttpJ.parsers.*;
import javaHttpJ.replay.*;
import lrapi.*;

public class Actions
{
  public int init(){
    return 0;
  }

    public int end(){return 0;}


    public int action() throws Throwable{

    String ENDFORM      =  "ENDFORM";
    String LAST         =  "LAST";
    String ENDITEM      =  "ENDITEM";
    String ITEMDATA     =  "ITEMDATA";
    String STARTHIDDENS =  "STARTHIDDENS";
    String ENDHIDDENS   =  "ENDHIDDENS";
    String CONNECT        =  "CONNECT";
    String RECEIVE      =  "RECEIVE";
    String RESOLVE        =  "RESOLVE";
    String REQUEST      =  "REQUEST";
    String RESPONSE        =  "RESPONSE";
    String EXTRARES     =  "EXTRARES";
    int _webresult; 

    try{

    lr.think_time(0);


    _webresult = lrapi.web.set_user("<UserID>", 
    //    lr.decrypt("54098d07e"), 
        "12345678", 
        "<url>:80");

    _webresult = lrapi.web.custom_request("Mobile", 
        "URL=<url>", new String[]{ 
        "Method=POST", 
        "Resource=0", 
        "RecContentType=application/octet-stream", 
        "Referer=", 
        "Snapshot=t1.inf", 
        "Mode=HTML", 
        "EncType=application/octet-stream", 
        "BodyBinary=\\x00\rRequestPacket\\x00\\x00\\x18getDataTransactionResult\\x00\\x00\\x00(\\x00\\x08Object[]\\x00\\x00\\x00\\x02\\x00\\x07Integer\\x00\\x00\\x00\\x00\\x00\\x07Integer\\x00\\x00\\x00\n\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\r" +
        "\\x00\\x00\\x08LANGUAGE\\x00\\x02en\\x00\\x07COUNTRY\\x00\\x02US\\x00\\x07APPNAME\\x00\\x00\\x08TIMEZONE\\x00\rAsia/Calcutta\\x00\\x11mobile.ssl\\x00\\x05false\\x00\\x07VARIANT\\x00\\x00\\x00\\x19mobile.contextname\\x00\\x1B/mobile/service\\x00\\x08MOBILEID\\x00\r" +
        "1409210548862\\x00\\x08USERNAME\\x00\\x08<UserID>\\x00\\x08PASSWORD\\x00\\x0812345678\\x00\\x07VERSION\\x00\\x011\\x00\\x12.mobile.port\\x00\\x0280", 
        LAST})    // couldn't decode request from body, couldn't decode response from body
;

    _webresult = lrapi.web.add_cookie("Path=/; DOMAIN=<url>");

    _webresult = lrapi.web.custom_request("Mobile_2", 
        "URL=<url>
        "Method=POST", 
        "Resource=0", 
        "RecContentType=application/octet-stream", 
        "Referer=", 
        "Snapshot=t2.inf", 
        "Mode=HTML", 
        "EncType=application/octet-stream", 
        "BodyBinary=\\x00\rRequestPacket\\x00\\x00\\x07REQUEST\\x86\\x00\\x00\\x0EcheckForUpdate\\x00\\x00\\x00B\\x00\\x08Object[]" +
        "\\x00\\x00\\x00\\x03\\x00\\x06String\\x00\\x02en\\x00\\x06String\\x00\\x1120140123042028406\\x00\\x06String\\x00\\x03PDA\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x0C\\x00\\mobile.hostname\\x00\\x16icms.indianrail.gov.in\\x00\\x08LANGUAGE\\x00\\x02en\\x00\\x07COUNTRY\\x00\\x02US\\x00\\x07APPNAME\\x00\\x00\\x08TIMEZONE\\x00\rAsia/" +
        "Calcutta\\x00\\x11.mobile.ssl\\x00\\x05false\\x00\\x07VARIANT\\x00\\x00\\x00\\.mobile.contextname\\x00\\x1B/mobile/mobileservice\\x00\\x08MOBILEID\\x00\r1409210548862\\x00\\x08USERNAME\\x00\\x08<UserID>\\x00\\x07VERSION\\x00\\x011\\x00\\x10.mobile.port\\x00\\x0280", 
        LAST})    // couldn't decode request from body, couldn't decode response from body


Viewing all articles
Browse latest Browse all 12134

Trending Articles