Loading ...
Sorry, an error occurred while loading the content.
 

Re: [LoadRunner] Scripting with Javascript that invokes Applets

Expand Messages
  • Alexander Podelko
    Yes, it may be not trivial. You are piling up ideas which may or may not make sense depending on the context. It is not evident from the script itself what
    Message 1 of 1 , Jan 31, 2009
      Yes, it may be not trivial. You are piling up ideas which may or may not make sense depending on the context. It is not evident from the script itself what you should do.
       
      What have you done to correlate the script? If you are not able to correlate, did you figure out why? Do you have API documentation?
       
      Alex

      --- On Sat, 1/31/09, hookipa_rox <hookipa_rox@...> wrote:

      From: hookipa_rox <hookipa_rox@...>
      Subject: [LoadRunner] Scripting with Javascript that invokes Applets
      To: LoadRunner@yahoogroups.com
      Date: Saturday, January 31, 2009, 1:06 AM

      Hi,

      I ran into problems with LR replay. The details and configurations below

      Scenario:
      Recording the login page of a Weblogic Portal application. The page
      downloads applets from the server and uses Javascript to invoke the
      applet API.

      This the LR configuration:
      1. LR v9.0
      2. Recording protocol: Web (HTML/HTTP)
      3. LR settings:
      User-Agent:
      Mozilla/4.0 (compatible; MSIE 6.0; Windows NT)
      Checked Simulate Browser Cache
      Checked Download non-HTML resources

      Recorded script:

      web_custom_request("ACMEApplet.jar",

      "URL=http://<HOSTNAME>:7005/ACMEIBCustLogonWebProj/resources/applet/ACME\
      Applet.jar",
      "Method=GET",
      /** "Resource=1", **/
      "Resource=0",
      "Referer=",
      LAST);

      web_custom_request("TFIACMEpplets.jar",

      "URL=http://<HOSTNAME>:7005/ACMEIBCustLogonWebProj/resources/applet/TFIA\
      CMEpplets.jar",
      "Method=GET",
      /** "Resource=1", **/
      "Resource=0",
      "Referer=",
      LAST);

      web_concurrent_end(NULL);

      lr_think_time(20);

      web_submit_data("processLogin.do",

      "Action=http://<HOSTNAME>:7005/ACMEIBCustLogonWebProj/com/ACME/ACMEIB/pa\
      geflow/logon/processLogin.do",
      "Method=POST",
      "RecContentType=text/html",

      "Referer=http://<HOSTNAME>:7005/ACMEIBCustLogonWebProj/com/ACME/ACMEIB/p\
      ageflow/logon/LogonController.jpf",
      "Snapshot=t9.inf",
      "Mode=HTTP",
      ITEMDATA,
      "Name={actionForm.hiddenUser}", "Value=LOGINID",
      ENDITEM,
      "Name={actionForm.hiddenCksPwd}",
      "Value=CD4C9784B6ABC80A685F6ABC6F89A582D2FA18800DCB2A9612332939818B1F7BD\
      2C60E4E78DFCD7C9B0F2DFBAC8331ED53DACC8323BD2CFBFA5E3A969F67524CD23620BB0\
      BA973D53BEFA7C482BE47A35587896A3560555691B69CAB148A02239CC6C8828D3E8C61B\
      C0C90BC1A01BB5E07C0F9A92C92B28802F1AA39DF84B9", ENDITEM,
      "Name={actionForm.hiddenSafentPwd}",
      "Value=62E2BA399100A2466987441612DC0983725E0BEEF2891620FF0F4B81126BD9EAF\
      CB14F5A130794B456B4D2104F2430C22A5621A032F7F3DE65F08CC36D4C8DA3BCB919426\
      28E02DA77F36C3C2115BE9980DC67AEF22C86E793017F2A6D19736B30B0B031A108A93AA\
      8B845E99768DE88E6012F8C06D57FF22D0B90542DB18225", ENDITEM,
      "Name={actionForm.hiddenSFNETEncodParam}",
      "Value=0A78AAA1036A74567482EA25EBB4C029", ENDITEM,
      "Name={actionForm.otSaltKey}",
      "Value=123322802285392816EB5", ENDITEM,
      "Name={actionForm.otSaltDesc}",
      "Value=A9F44A0E02C0D30355F6463103D24B6A", ENDITEM,
      "Name={actionForm.cksPubKeyValue}", "Value="

      "30820104028200800100DF9A106F8746DEA6FE52CF8B198E6F48FAAF36BC5C83DF52465\
      0C91D768E2F110C787AE461DD920530DA2164BEC154DD9CDB6CE690A8631788154BFCA6D\
      9827799A9F8BA20F04CC939B459130A33167414F52D34EA8E406375FD9A131F4DD268213\
      7C0D7F4A57B46DB76BF985150CF9808F9C49AD660866990463E83C0230282007C4144279\
      EE47C296098B440BA568F733309DACA7B433115C3ACA8C336B3A1DF5ED95513311768355\
      462469B44217B7960DBDD77A1BDE32C3802D2FB5EE7BAE6381EE7072D8F9991845C1F24B\
      4C69B79210D287CD62FF16421BF8EE962E4602256E33547F6BB4BBFE64E12208F36311D"
      "F3D8D879D4E62C55919F6BA3AF", ENDITEM,
      "Name={actionForm.SFNETModSize}", "Value=1024", ENDITEM,
      "Name={actionForm.SFNETExponenet}",
      "Value=00000000000000000000000000000000000000000000000000000000000000000\
      000000000000000000000000000000000000000000000000000000000000000000000000\
      000000000000000000000000000000000000000000000000000000000000000000000000\
      00000000000000000000000000000000000000000007A4B", ENDITEM,
      "Name={actionForm.SFNETPubKey}",
      "Value=A6A97098E5BD157531867F17E13686B0BDCD23EDD442BD264482262BEA739C381\
      36A37206EAA32705DD92E88C0CEB65F5201A005786D9948B962D41C1EF015D7BB8DBBA2C\
      2D04C534B65AD30116DF5242CC1D1D34A82922B0A935861CF68FE743D406788DE2310063\
      9B3FBA06F5E3B2BC6EE058118CEBEDA127050DB753920A3", ENDITEM,
      LAST);

      Troubleshooting observation:
      When the 2 applets are downloaded, the user enters the username and
      password, the Javascript invokes the API as shown in this .JSP page:

      JSP Page:
      <netui:imageAnchor formSubmit="true"
      src="../public/images/btn_submit.gif" border="0"
      width="134" height="24"
      onClick="return AppletEncription();"/></td>

      <APPLET CODE = "com.eracom.OBM.ACMEApplet.class"
      codebase="/ACMEIBCustLogonWebProj/resources/applet/"
      NAME="OBMApplet"
      ARCHIVE = "ACMEApplet.jar" WIDTH = "0" HEIGHT =
      "0">
      </APPLET>

      <applet name="TrustFieldExtApp"
      codebase="/ACMEIBCustLogonWebProj/resources/applet/"
      code="TrustFieldExtApp.class" archive="TFIACMEpplets.jar"
      width="2"
      height="2" VIEWASTEXT id="Applet1">

      Javasript:

      function AppletEncription() {
      bSuccess = true;

      if ((!AppletOK) || (document.TrustFieldExtApp == null)) {
      bSuccess = false;
      alert("Applet initialization failure");
      return false;
      }


      var isValidData=formValidation();
      if (isValidData) {
      bSuccess = true;
      } else{
      bSuccess = false;
      return false;
      }

      if (bSuccess && bCheckOnce(false)) {

      document.TrustFieldExtApp.load_PublicKey(document.logon1.pubKeyValue.val\
      ue);
      document.TrustFieldExtApp.addPIN(document.logon.PASSWORD1.value);
      document.TrustFieldExtApp.auth();

      var EPIN1 = document.TrustFieldExtApp.getEPIN();
      document.logon1.PASSWORD.value = EPIN1;
      document.logon1.USER.value = document.logon.USER.value;
      doEncryptUserLoginMsg();


      document.logon.PASSWORD1.value=document.logon.PASSWORD1.value.replace(/.\
      /g,' ');

      document.logon1.submit();
      SetOnce();
      return false;
      }
      }


      It seems that I'd need to store the applet .jar in the local machine
      (it's uniquely generated for each session) then calls its API to process
      the form fields. In summary, converting the Javascript into C Language
      (not sure how to invoke the API since only the .jar is available)

      Questions:
      1. Is this the solution to resolve this?
      If so, how to store the applet .jar (to the local machine) for later
      API execution? I considered web_dump_cache method but it doesn't seem to
      solve the problem.
      Once this is solved, how to store the values returned by the applet for
      later use in the script? I'm supposed to obtain some key EPIN1 and pass
      this key to another Javascript function which will use the keys to
      encrypt the fields using doEncryptUserLoginMsg()

      Is it necessary to convert the Javascript into C Language (to be
      compatible with Web Vuser script)? or should I convert the Web Vuser
      script to Java and run the applets in Java?

      2. If not, what is the solution suggested by the LR group?

      Thanks





      [Non-text portions of this message have been removed]


      ------------------------------------

      Yahoo! Groups Links





      [Non-text portions of this message have been removed]
    Your message has been successfully submitted and would be delivered to recipients shortly.