10 Replies Latest reply: May 24, 2012 2:44 AM by 793965 RSS

    playback is not working in OpenScript for loadtesting web/http wizard

    793965
      hi gems...

      i am facing another issue with OATS 12.1.0.1 while playing back the recorded scripts for load testing. But this time i dont know whether the remedy will come from our application or from OATS.

      I have recorded some simple steps in our application for loadtesting.
      My navigations in OpenScript:
      New > Load Testing(Protocol Automation) > Web/HTTP > Default Repository > Opened a blank script > started recording > Browser window got opened > hit the url of our application > logged in with a username/pasword > logged out.

      Scripts got recorded successfully. Now when i started playback, then it got failed with the error:
      +Failed to solve variable web.input.Submit using path .//input[@name='Submit']/@value+

      In our application, every sessionid gets captured and may be because of that recorded script and playback script made two different sessionids for login.
      Because when i did the comparison between the recorded and playback script, then i got the below line which is not matched between those two:
      +<form method="POST" id="formLogin" name="formLogin" action="/wm/j_spring_security_check;jsessionid=C9D732999E78008EC5CB3B77A6B703A4" onsubmit="return validateForm(this)">+

      jsessionid value is not matched between the recorded script and playback script.




      But when i did functional/regression testing of the same, then it worked perfectly without any failure.

      Kindly give your views. Thanks in advance.

      Edited by: gogol on May 23, 2012 12:44 AM
        • 1. Re: playback is not working in OpenScript for loadtesting web/http wizard
          Jamie_Lockhart
          The line should not match between record and playback as the jsessionid will change. There is a rule in the correlation library that should be dealing with the extraction and re-use of the jsessionid, so this isn't the issue - you should see a solve instruction for this in the script. I can't see enough to determine the exact issue but you could try deleting the instruction the solve the web.input.submit variable and try re-running.

          The fact that the functional script works makes no difference - load testing scripts work differently (at the http protocol level).

          Regards,
          Jamie
          • 2. Re: playback is not working in OpenScript for loadtesting web/http wizard
            793965
            Thanks Jamie for your reply...

            I think the problem is because of xPath...it cannot solve the variable web.input.submit.

            I have checked the java code generated, some of the lines are:

            http.solveXPath("web.input.Submit", "/window[@index='0']",
                                          ".//input[@name='Submit']/@value", "Sign In", 0,
                                          EncodeOptions.None);
            http.solveXPath("web.input.strutstokenname",
                                          "/window[@index='0']",
                                          ".//input[@name='struts.token.name']/@value",
                                          "struts.token", 0, EncodeOptions.None);
            http.solveXPath("web.input.strutstoken", "/window[@index='0']",
                                          ".//input[@name='struts.token']/@value",
                                          "MRI40AQ3ESY8SWMNKFMLECZJTKTPH4RE", 0,
                                          EncodeOptions.None);


            I think the first line is giving problem because before that the browser launches successfully.
            May i need to configure the xPath?? if yes, then how....

            pls help...thanks once again...
            • 3. Re: playback is not working in OpenScript for loadtesting web/http wizard
              glenn.s
              Can you show us the java code line for the navigation that happens before the failed xpath of web.input.submit? If that previous navigation has not substituted the jsessionid with a variable then the "formLogin" will not render correctly, which will then not allow web.input.Submit to be solved. Almost all fail to solve issues are the result of a previous flawed navigation.
              • 4. Re: playback is not working in OpenScript for loadtesting web/http wizard
                Jamie_Lockhart
                Hi,

                Yes, the issue is because it cannot locate the value it needs but do you really need to resolve it - the value when recording was "Sign In"? Does this change? If you delete the instruction then the recorded value - 'sign in' - will be used rather than a variable web.input.submit. This will be a way to get you over this hump, unless of course this is indicative of a completely different page being returned.

                When you say 'the browser launches successfully' what do you mean exactly? When playing back a load testing script you won't get a full browser instance - the script gets executed within the OpenScript context.

                Regards,
                Jamie
                • 5. Re: playback is not working in OpenScript for loadtesting web/http wizard
                  793965
                  below is the java code for the run block generated while recording:
                  public void run() throws Exception {
                            http.get(2, "http://ulx098.mazitek.com:8080/escort", null, null, true,
                                      "ISO8859_1", "ISO8859_1");
                            {
                                 http.solve("http.jsessionid", "jsessionid=(.+?)(?:\"|&)", "", true,
                                           Source.Html, 0, EncodeOptions.None);
                                 http.solveXPath("web.input.Submit",
                                           ".//INPUT[@name='Submit']/@value", "Sign In", 0,
                                           EncodeOptions.None);
                                 http.solveXPath("web.input.strutstokenname",
                                           ".//INPUT[@name='struts.token.name']/@value",
                                           "struts.token", 0, EncodeOptions.None);
                                 http.solveXPath("web.input.strutstoken",
                                           ".//INPUT[@name='struts.token']/@value",
                                           "G6CH0685ZPGKE6TUQUQRDES62AZRAT8J", 0, EncodeOptions.None);
                                 http.solveRefererHeader("referer.httpulx098mazitekcom808_1",
                                           "/escort/");
                            }
                            http.get(9, "http://ulx098.mazitek.com:8080/favicon.ico", null,
                                      null, true, "GB18030", "GB18030");
                            http
                                      .post(
                                                13,
                                                "http://ulx098.mazitek.com:8080/wm/j_spring_security_check;jsessionid={{http.jsessionid,9098A5983C686471BE1D2FCD7295CF40}}",
                                                null,
                                                http
                                                          .postdata(
                                                                    http.param("j_username", "escortadmin1"),
                                                                    http
                                                                              .param("j_password",
                                                                                        "70300886ea87fade932332926317f269598827246763436004b79e4f16c60813"),
                                                                    http.param("Submit",
                                                                              "{{web.input.Submit,Sign In}}"),
                                                                    http
                                                                              .param("struts.token.name",
                                                                                        "{{web.input.strutstokenname,struts.token}}"),
                                                                    http
                                                                              .param("struts.token",
                                                                                        "{{web.input.strutstoken,G6CH0685ZPGKE6TUQUQRDES62AZRAT8J}}")),
                                                http
                                                          .headers(http
                                                                    .header(
                                                                              "Referer",
                                                                              "http://ulx098.mazitek.com:8080{{referer.httpulx098mazitekcom808_1,/escort/}}",
                                                                              Header.HeaderAction.Modify)),
                                                true, "ISO8859_1", "ISO8859_1");
                            {
                                 http.solveXPath("web.link.Logout", ".//A[@title='Logout']/@href",
                                           "logout.jsp?logoutToken=0.5167720505173382", 0,
                                           EncodeOptions.None);
                                 http.solveRefererHeader("referer.httpulx098mazitekcom808_5",
                                           "/wm/globalLandingPoint.action");
                            }
                            http.get(21, "http://ulx098.mazitek.com:8080/favicon.ico", null,
                                      null, true, "GB18030", "GB18030");
                            http
                                      .get(
                                                25,
                                                "http://ulx098.mazitek.com:8080/escort/{{web.link.Logout,logout.jsp?logoutToken=0.5167720505173382}}",
                                                null,
                                                http
                                                          .headers(http
                                                                    .header(
                                                                              "Referer",
                                                                              "http://ulx098.mazitek.com:8080{{referer.httpulx098mazitekcom808_5,/wm/globalLandingPoint.action}}",
                                                                              Header.HeaderAction.Modify)),
                                                true, "ISO8859_1", "ISO8859_1");
                            http.get(31, "http://ulx098.mazitek.com:8080/favicon.ico", null,
                                      null, true, "GB18030", "GB18030");
                            
                       }
                  • 6. Re: playback is not working in OpenScript for loadtesting web/http wizard
                    793965
                    hi...

                    i think i am getting the problem...in the java code of the recorded script, i started the debugger and then i found that my playback is getting failed because of bad credentials, means it is not taking the password i gave during login in the time recording script.

                    Now, in our application, we encrypt the password....and when a user inputs the credentials, we do a spring security check(i dont know about that method at all) as validation. May be because of that encryption, it is failing, means it is not recognising the actual value of password which i have given during login.

                    But in this case what can i do....pls help me...
                    • 7. Re: playback is not working in OpenScript for loadtesting web/http wizard
                      glenn.s
                      That webpage must have some javascript that is creating the value for the "j_password" parameter.

                      .param("j_password", "70300886ea87fade932332926317f269598827246763436004b79e4f16c60813"),

                      Search in the html page for j_password and find the code that sets it in the javascript. Then using the same algorithm add java code to do the same thing in your script. It's possible that it is not javascript, for example it could be a java applet or some other external object, though it's not likely. Your in house developers created this application? If so ask them to give you the algorithm or java code snippet to enable you to set a cleartext password to a "j_password"
                      • 8. Re: playback is not working in OpenScript for loadtesting web/http wizard
                        855889
                        Hi,
                        Try replacing .param("j_password", "70300886ea87fade932332926317f269598827246763436004b79e4f16c60813") with .param("j_password", "xxxx") where xxxx is your original password, not the encrypted one.
                        Thanks,
                        Nags.
                        • 9. Re: playback is not working in OpenScript for loadtesting web/http wizard
                          793965
                          no...i have tried that earlier..i had placed my cleartext password in place of that, but it didnt work...still it was throwing the same bad credentials error.

                          Glen, even i am thinking the same. Yes, this code has been developed by the inhouse developers. I have told them to comment out the part where the encryption is taking place, they will do it and will take a new build to make the .war file. After that i will deploy it and rerun my test.
                          I will update this thread after this is done.

                          Thanks a lot gems for all your help...because of you all and the documentation i am learning the OATS.
                          • 10. Re: playback is not working in OpenScript for loadtesting web/http wizard
                            793965
                            Thanks Glen for your kind help...

                            The developers removed the validation from the code and then I deployed the application in tomcat. Recorded some activity and playback is successful.
                            An yeah, Load Testing with 50 virtual user is also successfull.

                            I owe it to you... :) :)