Monday 8 September 2014

Load testing and JD Edwards, testing rows returned

So, it’s a classic situation, by batch is not ready to post until my UBE is complete.  So I want my load testing script to being posting once the batch job is complete.  Difficult, no!  Not if you implement the correct methods.

The secret sauce is this:

clip_image002

Vs.

clip_image004

So you can easily go to WSJ and search for your user and jobname that is ‘P’, when it’s not p’ing (funny) then you are ready to Post!

My code here will assist you – very simple.

Firstly, search through your script for “No records found” (proper search – not find) and create a variable on the WSJ form with this – it’s an easy regular expression.


[sourcecode language='sql' ]
http.solve("NumberRecordsFound",

"<td class=gridheader>(.+?)</td>", "", false,

Source.Html, 0, EncodeOptions.None);

info("Record Counter {{NumberRecordsFound}}");



Then wrap the FIND (with your QBE) in a while loop, editing the java code.

while (getVariables().get("NumberRecordsFound").compareTo(StopSearch) != 0)

{
[/sourcecode]



I’ve also added a little sleep, because we don’t want to be just polling in our load test script:



[sourcecode language='sql' ]
try {

Thread.sleep(20000); //1000 milliseconds is one second.

} catch(InterruptedException ex) {

Thread.currentThread().interrupt();

}
[/sourcecode]




This will have you sorted in no time.


clip_image006





[sourcecode language='sql' ]
while (getVariables().get("NumberRecordsFound").compareTo(StopSearch) != 0)

{

try {

Thread.sleep(20000); //1000 milliseconds is one second.

} catch(InterruptedException ex) {

Thread.currentThread().interrupt();

}

{

http.post(

1376, "{{szERPURL,https://e1finpp.au.ad.westfield.com}}:93/jde/E1VirtualClient.mafService", http.querystring(http.param("e1.namespace",

""), http.param("e1.service",

"E1VirtualClient"), http.param(

"RENDER_MAFLET", "E1Menu"), http

.param("e1.state", "maximized"),

http.param("e1.mode", "view")), http.postdata(

http.param("jdemafjasLinkTarget",

"E1MENUMAIN_{{JdeMafJasLinkTarget,6673060528559646720}}"),

http.param("formOID", "W986110BA"),

http.param("guiChangeOnly", "1"),

http.param("stackId", "1"),

http.param("RID",

"{{GLOBAL_RID,ec56e0ead19ddb67}}"),

http.param("portalContainerType",

"Non-WebCenter"), http

.param("stateId", "5"),

http.param("eventCount", "3"), http

.param("posX", "0"), http

.param("posY", "0"),

http.param("0_cmd",

"gridScrollLeft0_1"), http

.param("0_ctrlVal", "865"),

http.param("1_cmd",

"gridScrollTop0_1"), http

.param("1_ctrlVal", "0"),

http.param("2_cmd", "0_23")), null, true, "UTF8", "UTF8");

{

http.solve("NumberRecordsFound",

"<td class=gridheader>(.+?)</td>", "", false,

Source.Html, 0, EncodeOptions.None);

info("Record Counter {{NumberRecordsFound}}");

}

http.get(

1380, "{{szERPURL,https://e1finpp.au.ad.westfield.com}}:93/jde/RecentReports.mafService", http.querystring(http.param("e1.namespace", ""),

http.param("e1.service", "RecentReports"),

http.param("RENDER_MAFLET", "E1Menu"),

http.param("e1.state", "maximized"),

http.param("e1.mode", "view"),

http.param("forceGoToDb", "false"),

http.param("amp;timestamp={{@timestamp()}}")), null, true, "UTF8", "UTF8");

http.get(

1384, "{{szERPURL,https://e1finpp.au.ad.westfield.com}}:93/jde/share/https_dummy.html", null, null, true, "UTF8", "UTF8");

}

}
[/sourcecode]

No comments: