ADF頁面在跳轉過程中有很多頁面的state會作爲reqeust的參數的一部分自動傳遞。因此,在使用一些測試工具進行壓力測試的時候,腳本錄製就變得非常困難。以LoadRunner爲例,必須正確配置LoadRunner的Correlation才能保證腳本在Replay過程中不會出現錯誤。 另外還需要注意ADF框架會在request的header中增加一些特殊的變量會影響到response,必須要保證錄製的request能夠保證一致性。
以下是一個LoadRunner Recording Rule的導出xml文件,可以用於錄製ADF的測試腳本。
<? xml
version = "1.0" ?>
< CorrelationSettings >
< Group
Name = "WebCenter"
Enable = "1"
Icon = "logo_default.bmp" >
< Rule
Name = "adf.ctrl-state"
LeftBoundText = "_adf.ctrl-state=" LeftBoundType = "1"
LeftBoundInstance = "0"
RightBoundText = '"' RightBoundType = "1"
AltRightBoundText = "Newline Character" AltRightBoundType = "4"
Flags = "137"
ParamPrefix = "adf.ctrl-state" Type = "8"
SaveOffset = "0"
SaveLen = "-1"
CallbackName = "" CallbackDLLName = ""
FormField = ""
ReplaceLB = ""
ReplaceRB = "" />
< Rule
Name = "adf.winId"
LeftBoundText = "_adf.winId="
LeftBoundType = "1" LeftBoundInstance = "0"
RightBoundText = "&"
RightBoundType = "1" AltRightBoundText = ""
AltRightBoundType = "1"
Flags = "137" ParamPrefix = "adf.winId"
Type = "8"
SaveOffset = "0"
SaveLen = "-1" CallbackName = ""
CallbackDLLName = ""
FormField = ""
ReplaceLB = "" ReplaceRB = "" />
< Rule
Name = "jsessionid"
LeftBoundText = "jsessionid="
LeftBoundType = "1" LeftBoundInstance = "0"
RightBoundText = '"'
RightBoundType = "1" AltRightBoundText = ""
AltRightBoundType = "1"
Flags = "136" ParamPrefix = "jsessionid"
Type = "8"
SaveOffset = "0"
SaveLen = "-1" CallbackName = ""
CallbackDLLName = ""
FormField = ""
ReplaceLB = "" ReplaceRB = "" />
< Rule
Name = "STATETOKEN"
LeftBoundText = 'javax.faces.ViewState" value="' LeftBoundType = "1"
LeftBoundInstance = "0"
RightBoundText='">' RightBoundType="1" AltRightBoundText="" AltRightBoundType="1"
Flags="136" ParamPrefix="STATETOKEN" Type="8" SaveOffset="0"
SaveLen="-1" CallbackName="" CallbackDLLName="" FormField=""
ReplaceLB="" ReplaceRB=""/>
< Rule
Name = "afrLoop"
LeftBoundText = "_afrLoop="
LeftBoundType = "1" LeftBoundInstance = "0"
RightBoundText = '"'
RightBoundType = "1" AltRightBoundText = ""
AltRightBoundType = "1"
Flags = "136" ParamPrefix = "afrLoop"
Type = "8"
SaveOffset = "0"
SaveLen = "-1" CallbackName = ""
CallbackDLLName = ""
FormField = ""
ReplaceLB = "" ReplaceRB = "" />
< Rule
Name = "adf.ctrl-state_new"
LeftBoundText = "_adf.ctrlstate=" LeftBoundType = "1"
LeftBoundInstance = "0"
RightBoundText = "<" RightBoundType = "1"
AltRightBoundText = ""
AltRightBoundType = "1" Flags = "9"
ParamPrefix = "adf.ctrl-state_new"
Type = "8"
SaveOffset = "0" SaveLen = "-1"
CallbackName = ""
CallbackDLLName = ""
FormField = "" ReplaceLB = ""
ReplaceRB = "" />
< Rule
Name = "SecurityUsersCreateUserPortletfrsc" LeftBoundText = 'SecurityUsersCreateUserPortletfrsc" value="' LeftBoundType = "1"
LeftBoundInstance = "0"
RightBoundText='">' RightBoundType="1" AltRightBoundText="" AltRightBoundType="1"
Flags="8" ParamPrefix="SecurityUsersCreateUserPortletfrsc"
Type="8" SaveOffset="0" SaveLen="-1" CallbackName=""
CallbackDLLName="" FormField="" ReplaceLB="" ReplaceRB=""/>
< Rule
Name = "CreatedPageName"
LeftBoundText = "/Page"
LeftBoundType = "1" LeftBoundInstance = "0"
RightBoundText = ".jspx"
RightBoundType = "1" AltRightBoundText = ""
AltRightBoundType = "1"
Flags = "1037" ParamPrefix = "createPageName"
Type = "8"
SaveOffset = "0"
SaveLen = "-1" CallbackName = ""
CallbackDLLName = ""
FormField = ""
ReplaceLB = "" ReplaceRB = "" />
< Rule
Name = "adfp_rendition_cahce_key" LeftBoundText = "_adfp_rendition_cahce_key="
LeftBoundType = "1" LeftBoundInstance = "0"
RightBoundText = "&"
RightBoundType = "1" AltRightBoundText = ""
AltRightBoundType = "1"
Flags = "8" ParamPrefix = "adfp_rendition_cahce_key"
Type = "8"
SaveOffset = "0" SaveLen = "-1"
CallbackName = ""
CallbackDLLName = ""
FormField = "" ReplaceLB = ""
ReplaceRB = "" />
< Rule
Name = "adfp_request_hash"
LeftBoundText = "_adfp_request_hash=" LeftBoundType = "1"
LeftBoundInstance = "0"
RightBoundText = '"' RightBoundType = "1"
AltRightBoundText = ""
AltRightBoundType = "1" Flags = "8"
ParamPrefix = "adfp_request_hash"
Type = "8"
SaveOffset = "0" SaveLen = "-1"
CallbackName = ""
CallbackDLLName = ""
FormField = "" ReplaceLB = ""
ReplaceRB = "" />
< Rule
Name = "adfp_full_page_mode_request" LeftBoundText = "_adfp_full_page_mode_request%3D"
LeftBoundType = "1" LeftBoundInstance = "0"
RightBoundText = "%"
RightBoundType = "1" AltRightBoundText = ""
AltRightBoundType = "1"
Flags = "8" ParamPrefix = "adfp_full_page_mode_request"
Type = "8"
SaveOffset = "0" SaveLen = "- 1"
CallbackName = ""
CallbackDLLName = ""
FormField = "" ReplaceLB = ""
ReplaceRB = "" />
< Rule
Name = "adfp_full_page_mode_request2" LeftBoundText = "_adfp_full_page_mode_request="
LeftBoundType = "1" LeftBoundInstance = "0"
RightBoundText = "&"
RightBoundType = "1" AltRightBoundText = ""
AltRightBoundType = "1"
Flags = "8" ParamPrefix = "adfp_full_page_mode_request2"
Type = "8"
SaveOffset = "0" SaveLen = "-1"
CallbackName = ""
CallbackDLLName = ""
FormField = "" ReplaceLB = ""
ReplaceRB = "" />
< Rule
Name = "afrLoop2"
LeftBoundText = "_afrLoop="
LeftBoundType = "1" LeftBoundInstance = "0"
RightBoundText = "<"
RightBoundType = "1" AltRightBoundText = ""
AltRightBoundType = "1"
Flags = "8" ParamPrefix = "afrLoop2"
Type = "8"
SaveOffset = "0"
SaveLen = "-1" CallbackName = ""
CallbackDLLName = ""
FormField = ""
ReplaceLB = "" ReplaceRB = "" />
< Rule
Name = "afrLoop3"
LeftBoundText = "_afrLoop="
LeftBoundType = "1" LeftBoundInstance = "0"
RightBoundText = "&"
RightBoundType = "1" AltRightBoundText = ""
AltRightBoundType = "1"
Flags = "136" ParamPrefix = "afrLoop3"
Type = "8"
SaveOffset = "0"
SaveLen = "-1" CallbackName = ""
CallbackDLLName = ""
FormField = ""
ReplaceLB = "" ReplaceRB = "" />
< Rule
Name = "wsrpresourceState"
LeftBoundText = "wsrp-resourceState~25253D" LeftBoundType = "1"
LeftBoundInstance = "0"
RightBoundText = "~252526" RightBoundType = "1"
AltRightBoundText = ""
AltRightBoundType = "1" Flags = "8"
ParamPrefix = "wsrp-resourceState"
Type = "8"
SaveOffset = "0" SaveLen = "-1"
CallbackName = ""
CallbackDLLName = ""
FormField = "" ReplaceLB = ""
ReplaceRB = "" />
< Rule
Name = "_afrWindowMode_checksum" LeftBoundText = "_afrWindowMode~253D0~26checksum~3D" LeftBoundType = "1"
LeftBoundInstance = "0" RightBoundText = "/container-view"
RightBoundType = "1" AltRightBoundText = ""
AltRightBoundType = "1"
Flags = "8" ParamPrefix = "_afrWindowMode_checksum"
Type = "8"
SaveOffset = "0" SaveLen = "-1"
CallbackName = ""
CallbackDLLName = ""
FormField = "" ReplaceLB = ""
ReplaceRB = "" />
</ Group >
</ CorrelationSettings > |