Issue with Correlation using Gatling Performance Testing tool - correlation

I am new to Gatling
From last 5 days, I am trying to capture below request but I am unable to correlate the below "sesskey" which will be used in throughout my whole flow :
.feed(feeder)
.exec(http("request_2")
.post("/login/index.php")
.headers(headers_0)
.formParam("username", "${username}")
.formParam("password", "${password}")
.formParam("anchor", "")
.resources(http("request_3")
.get("/theme/image.php/clean/core/1468244430/t/block_to_dock"),
http("request_4")
.get("/lib/javascript.php/1468244430/blocks/course_overview/module.js"),
http("request_5")
.get("/theme/image.php/clean/core/1468244430/t/collapsed"),
http("request_6")
.get("/theme/image.php/clean/core/1468244430/t/expanded"),
http("request_7")
.get("/lib/requirejs.php/1468244430/core/first.js"),
http("request_8")
.get("/theme/yui_combo.php?3.17.2/anim-base/anim-base.js&3.17.2/anim-color/anim-color.js&3.17.2/anim-xy/anim-xy.js&3.17.2/anim-curve/anim-curve.js&3.17.2/anim-easing/anim-easing.js&3.17.2/anim-node-plugin/anim-node-plugin.js&3.17.2/anim-scroll/anim-scroll.js"),
http("request_9")
.get("/lib/javascript.php/1468244430/lib/requirejs/jquery-private.js"),
http("request_10")
.get("/theme/yui_combo.php?3.17.2/cssbutton/cssbutton-min.css")
.headers(headers_10),
http("request_11")
.get("/lib/javascript.php/1468244430/lib/jquery/jquery-1.12.1.min.js"),
http("request_12")
.get("/theme/yui_combo.php?3.17.2/handlebars-base/handlebars-base.js&3.17.2/handlebars-compiler/handlebars-compiler.js&m/1468244430/core/handlebars/handlebars-debug.js&3.17.2/plugin/plugin.js&m/1468244430/core/lockscroll/lockscroll-debug.js&m/1468244430/core/notification/notification-ajaxexception-debug.js&m/1468244430/core/notification/notification-alert-debug.js&m/1468244430/core/notification/notification-exception-debug.js&m/1468244430/core_message/messenger/messenger-debug.js"),
http("request_13")
.get("/theme/yui_combo.php?m/1468244430/calendar/info/info.css")
.headers(headers_10),
http("request_14")
.get("/theme/yui_combo.php?m/1468244430/calendar/info/info-debug.js"),
http("request_15")
.post("/lib/ajax/service.php?sesskey=LuyCPEUwdm")
.headers(headers_1)
.body(RawFileBody("MoodleViewPageV01_0015_request.txt")),
http("request_16")
.get("/theme/yui_combo.php?m/1468244430/core/formautosubmit/formautosubmit-debug.js"),
http("request_17")
.get("/theme/yui_combo.php?3.17.2/event-mousewheel/event-mousewheel.js&3.17.2/event-resize/event-resize.js&3.17.2/event-hover/event-hover.js&3.17.2/event-touch/event-touch.js&3.17.2/event-move/event-move.js&3.17.2/event-flick/event-flick.js&3.17.2/event-valuechange/event-valuechange.js&3.17.2/event-tap/event-tap.js&3.17.2/event-simulate/event-simulate.js&3.17.2/async-queue/async-queue.js&3.17.2/gesture-simulate/gesture-simulate.js&3.17.2/node-event-simulate/node-event-simulate.js&m/1468244430/core/actionmenu/actionmenu-debug.js"),
http("request_18")
.get("/theme/image.php/clean/core/1468244430/t/switch_minus"),
http("request_19")
.get("/theme/image.php/clean/core/1468244430/t/switch_plus")))
In the request above, Request_15 where you will get .post("/lib/ajax/service.php?sesskey=LuyCPEUwdm") and I want to capture sesskey value LuyCPEUwdm which will be going to used multiple times during my scenario.
How I should capture that key ?
Please help
Appreciate your time :)

I got the answer.
Here, When you will going to record the script using recorder, There...You need to select "save & check Response bodies?" option and then go for recording
So after recording completed, Your response will be stored in "..\gatling-charts-highcharts-bundle-2.2.2\user-files\bodies" path
So you can compare the scenario of your script with the response body files and correlate that value based on captured value in the response body files

Related

Displaying JSON output from an API call in Ruby using VScode

For context, I'm someone with zero experience in Ruby - I just asked my Senior Dev to copy-paste me some of his Ruby code so I could try to work with some APIs that he ended up putting off because he was too busy.
So I'm using an API wrapper called zoho_hub, used as a wrapper for Zoho APIs (https://github.com/rikas/zoho_hub/blob/master/README.md).
My IDE is VSCode.
I execute the entire length of the code, and I'm faced with this:
[Done] exited with code=0 in 1.26 seconds
The API is supposed to return a paginated list of records, but I don't see anything outputted in VSCode, despite the fact that no error is being reflected. The last 2 lines of my code are:
ZohoHub.connection.get 'Leads'
p "testing"
I use the dummy string "testing" to make sure that it's being executed up till the very end, and it does get printed.
This has been baffling me for hours now - is my response actually being outputted somewhere, and I just can't see it??
Ruby does not print anything unless you tell it to. For debugging there is a pretty printing method available called pp, which is decent for trying to print structured data.
In this case, if you want to output the records that your get method returns, you would do:
pp ZohoHub.connection.get 'Leads'
To get the next page you can look at the source code, and you will see the get request has an additional Hash parameter.
def get(path, params = {})
Then you have to read the Zoho API documentation for get, and you will see that the page is requested using the page param.
Therefore we can finally piece it together:
pp ZohoHub.connection.get('Leads', page: NNN)
Where NNN is the number of the page you want to request.

TestComplete_JavaScripting_how to hide web url path while performing any operation for any object in script

I'm new to use Testcomplete , i'm using javascripts to automate my code, below are sample script ( converted one recorded first then converted into jscript) and in this scripts what i observe that TestComplete identified and captured the object element by using complete web url path not on only object specific .
efunction Test_Login {var UserName, Password, TestEnv;UserName = "XYZ";Pwd = "XYZXYZ";TestEnv = "https://test.Env.com/";Browsers.Item(btChrome).Run("TestEnv",1);Aliases.browser.pageTestenvCom.formFrmlogincomponent.textboxUsername.SetText("UserName");Aliases.browser.pageTestenvCom.formFrmlogincomponent.passwordboxPassword.SetText("Pwd");Aliases.browser.pageTestenvCom.formFrmlogincomponent.buttonLogin.ClickButton();}e
what i means lets see below example of login page
thank you
Whenever we record any Test case in Test-Complete, it stores all the object in the Naming Repository and then access the same.
This helps test-complete in easily recognisation of object and can improve the speed of test-case, in case there are multiple objects visible on screen
You can go through following link for more info on Name Mapping.
https://support.smartbear.com/testcomplete/docs/testing-with/object-identification/name-mapping/overview.html

LoadRunner - Manual Correlation - Unable to get the value using web_reg_save_param

I am using LoadRunner to test the performance of an application which is a Siebel CRM based application. The issue I am facing is I am not able to get the SRN number which is unique for each of the session.
The code I am using to capture SRN is below
//HELLO YOUR CODE STARTS HERE.....FOR MANUAL CORRELATION
web_reg_save_param("Siebel_SRN",
"NOTFOUND=ERROR",
"LB=SRN`",
"RB=`",
"Ord=All",
"Search=All",
"IgnoreRedirections=Yes",
"RelFrameId=All",
LAST);
lr_output_message( "Siebel_SRN value is %s", lr_eval_string( "{Siebel_SRN}" ) );
//HELLO YOUR CODE ENDS HERE.....FOR MANUAL CORRELATION
If I search by SRN` I am able to see the SRN value.
Below is the response I am getting from the server. I am setting the boundary correctly ( I believe so ) but not able to get the SRN value.
vuser_init.c(161): 7/23048/scripts/HICalendarUI.htm`sui`false`vfn`_sweclient._swecontent._sweview`IsWebSocket
vuser_init.c(161): BSReady`false`WebSocketServerPort``SweBusyTimer`30`lt`1471312453347`MR1`Y`cqt`-1`ui`L17LOA
vuser_init.c(161): D`IsAutoOn`false`ect`Link`SRN`ABrcHGKVMlEGktXB3ekmRUEOy6rYzkMmy7OicIW0yHMb`ec`<span class=
vuser_init.c(161): \\"siebui-icon-icon_select\\"><img src=\\"images/icon_select.gif\\" border=\\"0\\" align=\\
vuser_init.c(161): "absmiddle\\" alt=\\"Pick Applet\\" title=\\"Pick Applet\\" >\\<\\/span>`cks`1-14TA9_DHHS
vuser_init.c(161): +L17_43%7c1470288710%7c1471223560_0_23048__L`vs`15.9.0.0 SIA [23048] ENU`USC`1`IsMsgBarEna
vuser_init.c(161): bled`true`lodc`0`IsMobileApplication`false`iri`<span class=\\"siebui-icon-icon_required\\"
vuser_init.c(161): ><img src=\\"images/icon_req.gif\\" border=\\"0\\" space=\\"0\\" hspace=\\"0\\" alt=\\"Req
I am getting the below message while replaying
No match found for the requested parameter "Siebel_SRN". Either the specified boundaries
were not found in the response or the matched text is longer than current max html parameter size of 999999 bytes.
The total length of the response is 15062 bytes. You can use
"web_set_max_html_param_len" to increase the max parameter size. [MsgId: MERR-26377] [Time:2016-08-16 11:54:27]
and the output for Siebel_SRN is
user_init.c(296): Registering web_reg_save_param was successful [MsgId: MMSG-26390]
vuser_init.c(307): Warning: The string 'Siebel_SRN' with parameter delimiters is not a parameter.
vuser_init.c(307): Siebel_SRN value is {Siebel_SRN} [Time:2016-08-16 11:54:21]
I am doing something silly. But not able to figure it out.Please help me in resolving this issue. Advance Thanks
First of all, make sure you placed the web_reg_save_param before the target request step (web_url, web_custom_request, web_submit_form etc.) as correlations should always be registered beforehand.
Also you should not pass Ord=All argument: it creates an array on parameters like Siebel_SRN_1, Siebel_SRN_2 and so on. In your case, there is only one instance of the SRN value in the response. IgnoreRedirections=Yes looks odd as well: ignoring HTTP redirections is not needed in general case. Check the official documentation for more information.

How do I correlate two identically coded variables sent in the response from a Worklight server response string in LoadRunner 12.02?

I am trying to create a load test versus one of our apps that is used on web and mobile. I am trying to access this app from the web. I login to the website. Using this login, I click on the web version of the app. The below response is returned here.
This app is using SiteMinder and Worklight to negotiate with the main site I am coming from.
My question is, how do I correlate a value such as 'SMIDENTITY=' when it is being returned TWICE in the same string?
Here is an example of what is being returned by the server (I have broken up the string so the variables are separated:
Test4.c(225):
Cookie:testcookie=oreo;
SMIDENTITY=Cq16kwJwrJWgBd5zQ8ci0kP8IEZ47kftOxMr1wVsxx+W/7sGS92ZA9zu69GRpolh0PRX97bvfHRya0m1ty1E07qR0HjKKXE8ypRsWPgG4m2w8mlspPUxL8t5Z4RE5/CCJpOxpXHIHeQK4f77gkihKFq8cBQr+Vy9kZGFGMUJH6+EiLNmmJT+XYZcUi7gzV0r+naJypMewtXAYaOcvn8Kqsu2JA5SiNUcJbxxX4dNCHOsC4cf45Jm0H40Efq6nOwN7MDyAE2gXSou4oa9ZlYxlsvWdEVl6CxgnqnqEkBJYVuBsgj/277+F7q9KB4xpct/sYvRT9CR/Rvh79hmpJJedH+lA8A6UtqyA21CnECQJzrbKJJgx3eeyN86BQv3g/kOWJ2CE4txEn22U+AjMKmxgB7fmLTNdxKS5+sn9P/Fs+TGwhRSX3pr/l1h4NQpNzb1Rz1fbt80/ODWbLSlBFBmQTCCRkLx54dcR40lH0iDl9543KZCAphpzKXS429ZZyCH00xdITd4vpab/l9cWZEHuoJFbgf4yWmx6eGo6zdPxb6Yv/D2EM9GnXnWsF14lrI4XtlreE+9o3EXSTbbz+MHh/ym/LzA4zaul4luiPMUNAnP+qatTR9WvK1NsC2KgsQl;
_ga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NIEb5ry1QGBho0OAeXQvlYeXiPZfKknu66iJpPEQaIpj0csWThztytn7uDuAiTCPZ4Yhwm+6pYHhxp7Jx/U84L2u3M7BamqD+oiCrFaYpMXkCGHw99hbHhE1okP3q+Hb/TCODKwIG80lw7660Y+nFGMIaCreNeu0Em+dY7rTU+KubyJqeYtt/NssB1Qq945MShkhix+KDKE+ViNmmyRqyUQpTEx6fXgbJQihm7KguDfOJSxvsalaO3vAwwN/mJTSxcRVktIaAYT4ZcakZS5r/mLRVllQmOczO4Ex2zAgflcEZ3GUlG3+TuL6JCYVWI3haAa0wUWffLCYRPo/n2+4vl5v/x9HkTXIZe0p4JCS1nWpzZXsg==;
LtpaToken=EHYGd9YV18oZsd8vSkJGm6EitmZCspgF2RbWMb/kDol6urQ8ZBeespgw8VR0jXPkwKdnAQjJ5x4ZdmTexnZiL3QIVzdH+DwWbTNP4KBAe/cdizYf8/0w05B9N13YX4rT7xl/Y0ZUhZX1brNgM7zP19a4IjL0E0M5uK2qah9ggErQhovcziPkA6Uubd4ne5keV/H/S0ZdaRMSjhXp6njlRtJl6C2U5r91YTXYVnbnl+sgG88g9jnPa6+peg+yi4P9VeoSohydoAIrqBGbpr7yL9ocaO3dL6bq/Ff6WAWZuca1V+7+x4bxtWHQ2CgafibbAkowunOsCyHvCRbv2FH8MQ==;
JSESSIONID=0000QLn5MU6tB5uMM0bXlOC8ZYS:15b4l3mm8;
SITE_ENTRY_JUMPTO=polhome;
scoreboard="";
scoreboardReport="";
WLSESSIONID=0000Xr6ZS67VI4UH-HoycrnVBq1:18lm04lom\r\n
Use the Ordinal (or index) number of the instance of the variable which you need as part of your collection
See training material or online help for correlation functions related to ordinal value
You didn't say what you're actually trying to do. Do you need only use the most recent? only use the first?
You use a web_reg_save_param_ex to capture all Ordinals of a parameter. It puts it into an array.
You can then do what you want with that array.
You can also use a web_reg_save_param_regexp
I coped the code from the official documentation and put your variable name in there to make it easier for you.
web_reg_save_param_ex(
"ParamName=SMIDENTITY",
"LB/IC=SMIDENTITY=",
"RB/IC=;",
"Ordinal=all",
LAST);
web_submit_data("...");
/* Getting individual elements from a parameter array.
Since the parameter created by web_reg_save_param_ex
is called "SMIDENTITY", the number of elements
is saved in parameter "SMIDENTITY_count".
The array elements are parameters "SMIDENTITY_1",
"SMIDENTITY_2", ... "SMIDENTITY_n".
*/
elemCnt = atoi(lr_eval_string("{SMIDENTITY_count}"));
lr_output_message("Number of items found = %d",elemCnt);
for (x=1;x<=elemCnt;x++) {
sprintf(arrayParamName, "{SMIDENTITY_%d}", x);
lr_output_message ("%s: %s",
arrayParamName,
lr_eval_string(arrayParamName));
}

HP UFT API Test - Saving Response/Checkpoint values

Is there a way to capture and store (or write to a file) the values returned in the Response? (Checkpoint values)
Using HP UFT 11.52
Thanks,
Lynn
I figured it out. In UFT API under Standard Activities, there are File function modules including "Write to File". I added the module to the test, set the path and other properties, passed the variable to the file and it worked! Couldn't be easier.
I mentioned this on my other answer , you can also write it programatically if you have dynamic array response please refer below:
https://stackoverflow.com/a/28012383/3972994
After running a test, in the test folder, you can find a Snapshots/LastIteration directory.
In it you can find the return value for each step saved in a txt file.
Pay attention that if you data drive the step, only the last iteration will be saved to file.
However, in the Test's log (Test dir/Log/vtd_user.log) you can find all the iterations persisted
Thanks,
Yossi
You do not need to use the standard activities if you do this
var iResponse = this.Activity.responsebody;
System.IO.File.WriteLines(#"directorypath&FileName);
the above will write the response to the file and rewrite it for every run

Resources