Hello
I've got an ADF 11g faces application using ADF security.
I've created a load testing script which starts as shown below (the strings s,s1,s2 were added by me for debugging)
beginStep("[1] No Title", 0);
{
http.get(149, "http://srv-weblogic-rhel5:7001/trac/faces/tracMain",
null, null, true, "UTF8", "UTF8");
String s = http.getLastResponseContents();
http
.get(
153,
"http://srv-weblogic-rhel5:7001/trac/faces/tracMain;jsessionid=MKsTL95dmsTzMFDrlpGKmkvhL3TFTySw8WxnFHwDHN5pNpKpMMv1!-24247386",
http.querystring(http.param("_afrLoop",
"4414186480719579"), http.param(
"_afrWindowMode", "0"), http.param(
"_afrWindowId", "null")), null, true,
"UTF8", "UTF8");
String s1 = http.getLastResponseContents();
http.get(161,
"http://srv-weblogic-rhel5:7001/trac/faces/login.jspx",
http.querystring(
http.param("_afrLoop", "4414186547201678"), http
.param("_afrWindowMode", "0"), http.param(
"_afrWindowId", "null")), null, true,
"UTF8", "UTF8");
String s2 = http.getLastResponseContents();
The above lines have a result of "Passed" but I'm 99% certain that the page received is not the login page for the application.
This would explain why everything else in the script fails to find the objects they are looking for even if http.solveXPath or http.solve is used.
s,s1 and s2 all have the following in them
<html lang="en-US"><head><script>
/*
** Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
*/
/**
* This is the loopback script to process the url before the real page loads. It introduces
* a separate round trip. During this first roundtrip, we currently do two things:
* - check the url hash portion, this is for the PPR Navigation.
* - do the new window detection
* the above two are both controled by parameters in web.xml
*
* Since it's very lightweight, so the network latency is the only impact.
*
* here are the list of will-pass-in parameters (these will replace the param in this whole
* pattern:
* viewIdLength view Id length (characters),
* loopbackIdParam loopback Id param name,
* loopbackId loopback Id,
* loopbackIdParamMatchExpr loopback Id match expression,
* windowModeIdParam window mode param name,
* windowModeParamMatchExpr window mode match expression,
* clientWindowIdParam client window Id param name,
* clientWindowIdParamMatchExpr client window Id match expression,
* windowId window Id,
* initPageLaunch initPageLaunch,
* enableNewWindowDetect whether we want to enable new window detection
* jsessionId session Id that needs to be appended to the redirect URL
* enablePPRNav whether we want to enable PPR Navigation
*
*/
var id = null;
var query = null;
var href = document.location.href;
var hashIndex = href.indexOf("#");
var hash = null;
/* process the hash part of the url, split the url */
if (hashIndex > 0)
{
hash = href.substring(hashIndex + 1);
/* only analyze hash when pprNav is on (bug 8832771) */
if (false && hash && hash.length > 0)
{
hash = decodeURIComponent(hash);
if (hash.charAt(0) == "@")
{
query = hash.substring(1);
}
else
{
var state = hash.split("@");
id = state[0];
query = state[1];
}
}
href = href.substring(0, hashIndex);
}
/* process the query part */
var queryIndex = href.indexOf("?");
if (queryIndex > 0)
{
/* only when pprNav is on, we take in the query from the hash portion */
query = (query || (id && id.length>0))? query: href.substring(queryIndex);
href = href.substring(0, queryIndex);
}
var jsessionIndex = href.indexOf(';');
if (jsessionIndex > 0)
{
href = href.substring(0, jsessionIndex);
}
/* we will replace the viewId only when pprNav is turned on (bug 8832771) */
if (false)
{
if (id != null && id.length > 0)
{
href = href.substring(0, href.length - 9) + id;
}
}
var isSet = false;
if (query == null || query.length == 0)
{
query = "?";
}
else if (query.indexOf("_afrLoop=") >= 0)
{
isSet = true;
query = query.replace(/_afrLoop=\d*/, "_afrLoop=4491899108327723");
}
else
{
query += "&";
}
if (!isSet)
{
query = query += "_afrLoop=4491899108327723";
}
/* below is the new window detection logic */
if ((true) && (window.name==null || window.name=="" || window.name!="null"))
{
/* append the _afrWindowMode param */
var windowMode;
if (true)
{
/* this is the initial page launch case,
also this could be that we couldn't detect the real windowId from the server side */
windowMode=0;
}
else if ((href.indexOf("/__ADFvDlg__") > 0) || (query.indexOf("__ADFvDlg__") >= 0))
{
/* this is the dialog case */
windowMode=1;
}
else
{
/* this is the ctrl-N case */
windowMode=2;
}
if (query.indexOf("_afrWindowMode=") >= 0)
{
query = query.replace(/_afrWindowMode=\d*/, "_afrWindowMode="+windowMode);
}
else
{
query = query += "&_afrWindowMode="+windowMode;
}
/* append the _afrWindowId param */
var clientWindowId;
/* in case we couldn't detect the windowId from the server side */
if (window.name==null || window.name=="")
{
clientWindowId = "null";
}
else
{
clientWindowId = window.name;
}
if (query.indexOf("_afrWindowId=") >= 0)
{
query = query.replace(/_afrWindowId=\w*/, "_afrWindowId="+clientWindowId);
}
else
{
query = query += "&_afrWindowId="+clientWindowId;
}
}
var sess = ";jsessionid=ZTJ6L2pNfvmcYZ2Ww3L6TKqy3s9byJpLDtX832sGZtJQLyvnlnSw!-24247386";
if (sess.length > 0)
href += sess;
/* if pprNav is on, then the hash portion should have already been processed */
if ((false) || (hash == null))
document.location.replace(href + query);
else
document.location.replace(href + query + "#" + hash);
</script><noscript>This page uses JavaScript and requires a JavaScript enabled
browser. Your browser is not JavaScript enabled.</noscript></head></html>
Can anybody explain what is going on or point me to a document on how to use OpenScript load testing with ADF security or will this be addressed in the 9.1
Sorry to carry on with ADF faces but we are now at a point in our development where we need to load test, function testing with OpenScript seems to work ok.
Regards
Paul