Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Topics
Part 1 - Planning the Test Suite Part 2 - Recording the Tests Part 3 - Customizing Recorded Scripts for Execution Part 4 - Supporting Multi-User concurrency Part 5 Debugging scripts in single and multi-user mode
What operations should be simulated? What is the relative ratio of operations? How many users perform each type of operation? How often are those operations performed? How much time between operations?
Power Users
Use DMS as their primary work tool Log in once and work in the application constantly for a given period of time Infrequently log out or time out
Regular Users
Use DMS as a part of their daily tasks, but not exclusively May log in, checkout a document, work on it for a while, return to DMS later in the day Will often close browser or navigate away, or simply time out, ending their session
Occasional Users
Use DMS to support their work, but not as a primary tool May have short burst of activity, followed by no activity for hours or days
Think time should reflect natural application behavior Pacing should be realistic for the user type (power, regular or occasional)
Power think time as recorded, 4-6 mins between iterations Regular think time as recorded, 8-12 mins between iterations Occasional double think time, 18-22 minutes between iterations
Recommendation: always use EXPORT and CHECKOUT for successful script execution
Allows you to repeat actions without having to log out and log back in, simulating more realistic user activity
Capture key parameters at the end of each action, and use them at the beginning of each action
Objectlist.jsp saveClientRequestId(), saveOldFolderPath(), savePageIndex() Browsertree.jsp saveBrowsertreeRequestId() Menubar.jsp saveMenubarRequestId() Titlebar.jsp saveTitlebarRequestId()
To expand the tree, pass the value in the id tag to treeExpandNode.jsp as browsertree_docbrowser_hidden_focus_0 To open the folder, pass it to the browserTree.jsp as browsertree_docbrowser_hidden_focus_0 and browsertree_docbrowser_hidden_sel_0
Copyright 2008 EMC Corporation. All rights reserved. 9
10
Be sure to turn on the correlation rules provided in the LoadRunner kits from the developer website (provided in script directory as EMCDocumentum.cor)
Copyright 2008 EMC Corporation. All rights reserved. 11
12
Add Username parameter to enable multi-user testing Add UCF capability where needed
Vuser_init:
Add extern
Add setUID calls before each URL with dmfUcfClientId in the URL or POST data Replace hard-coded UID with {UID} in URL or POST data Modify wdk5-appletresultsink for import and export actions Add code to delete the file from before performing an export operation Add function to create per-user export directory
Add randomization and parameterization for hard-coded r_object_id values Add custom transactions to aid in monitoring
Copyright 2008 EMC Corporation. All rights reserved. 13
JSESSIONID
Capture at the beginning of the script
web_reg_save_param("jsess", "LB/IC=JSESSIONID=", "RB/IC=;", "Ord=1", "Search=headers", "RelFrameId=1", "Notfound=warning", LAST);
14
Cookies (web_add_cookie)
Remove or comment them out
Find any URLs with hard-coded object ID values and parameterize them
BrowserTree and navigation use ID values extensively
15
16
wdk5-appletresultsink
web_custom_request("wdk5-appletresultsink",
Original "URL=http://{Hostname}:{PortNum}/{Context}/wdk5-appletresultsink", recorded values "Method=POST", "Resource=1", Special "RecContentType=application/x-java-serialized-object", parameters to "EncType=application/x-deflated-java-serialized-object", be used to "BodyBinary=x\\x9C\\x8DR;N\\xC3@\\x10\\.............................", simulate LAST); applet from LoadRunner web_submit_data("wdk5-appletresultsink",
"Action=http://{Hostname}:{PortNum}/{Context}/wdk5-appletresultsink", "Method=POST", "RecContentType=text/html", "Mode=HTML", ITEMDATA, "Name=key", "Value=UcfImportContainer_fileselector_0", ENDITEM, "Name=value", "Value={ImportFile}", ENDITEM, LAST);
17
wdk5-appletresultsink
UcfExportContainer_selectdestfolder_0
Folderpath must end in a slash
If the Import or Export component has been modified, the name will change
web_submit_data("wdk5-appletresultsink", "Action=https://{Hostname}/<appname>/wdk5-appletresultsink", "Method=POST", "Referer=https://{Hostname}/<appname>/wdk/system/ucf/invoker.jsp", "RecContentType=text/html", "Snapshot=t9.inf", "Mode=HTML", ITEMDATA, "Name=key", "Value=TlsImportContainer_fileselector_0", ENDITEM, "Name=value", "Value={ImportFile}", ENDITEM, LAST)
Copyright 2008 EMC Corporation. All rights reserved. 18
web_submit_data("wdk5-appletresultsink", "Action={Protocol}://{Hostname}:{Port}/{Context}/wdk5-appletresultsink", "Method=POST", "Referer={Protocol}://{Hostname}:{Port}/{Context}/wdk/system/ucf/invoker.jsp", "RecContentType=text/plain", "Snapshot=t9.inf", "Mode=HTML", ITEMDATA, "Name=key", "Value=TlsImportContainer_fileselector_0", ENDITEM, "Name=value", "Value=c:\\ucf\\import\\0010\\1.zip", ENDITEM, "Name=value", "Value=c:\\ucf\\import\\0010\\2.zip", ENDITEM, "Name=value", "Value=c:\\ucf\\import\\0010\\3.zip", ENDITEM, "Name=value", "Value=c:\\ucf\\import\\0010\\4.zip", ENDITEM, "Name=value", "Value=c:\\ucf\\import\\0010\\5.zip", ENDITEM, LAST);
19
20
10
3. In vuser_init section define getUID function and load the client DLL
extern int getUID(int invokerPort, char* ucfMode, char* host, int port, char* approot, char* jsessid, char *msg); vuser_init () { lr_load_dll(c:\\UCFInvoker\\TDfUCFInvokerClient.dll");
4. Copy the setUID function from the lr_utils Action in the sample scripts into your script.
21
4.
Call setUID just before any request that contains __dmfUcfClientId in the URL or the POST data
setUID("UID"); web_url("invoker.jsp;jsessionid={jsess}_2", "URL={Protocol}://{Hostname}:{Port}/{Context}/wdk/system/ucf/invoker.jsp;jsessi onid={jsess}?__dmfRequestId={ReqId1_113}&__dmfHandler=UcfInvoker_0&__dmfAction= onInvokeUcfDone&__dmfUcfClientId=12%3B{UcfKey_112}&__dmfUcfClientReqKey={UcfKey _112}&__dmfHandlerArgs=&Reload=109884e9089",
setUID should NOT be called if the dmfUcfClientId is in the Referer section only
22
11
23
Delete the file before performing export void deleteFile() { char buf[100]; int errno; strcpy(buf,lr_eval_string("{ExportFile}")); lr_output_message("DEBUG: Deleting document %s",buf); if (remove(lr_eval_string("{ExportFile}")) == 0) lr_output_message("Removed new file %s", lr_eval_string("{ExportFile}")); else lr_output_message("Unable to remove %s error %d", lr_eval_string("{ExportFile}"), errno); }
24
12
UCF communication is also over HTTP, therefore gets recorded UCF requests will be now managed by UCF Invoker Comment out or delete any URL requests with:
InitGAIRConnector GAIRConnector Notification ACS
25
In normal operation, the applet jar files are downloaded and installed on first request in session
ucfinit.cab fileselection.cab
Simulation will force download each time To reduce the overhead, these can be commented out in scripts
web_url("invoker.jsp", "URL={Protocol}://{Hostname}:{Port}/{Context}/wdk/system/ucf/invoker.jsp?__dmf .. EXTRARES, //"Url=../ucfinit.cab", "Referer=", ENDITEM, //"Url=/{Context}/wdk/contentXfer/ucf.installer.config.xml", "Referer=", ENDITEM, LAST);
Copyright 2008 EMC Corporation. All rights reserved. 26
13
Checkout/Checkin
Locked by you, locked by others
27
<input type=checkbox id=actionmultiselectcheckbox_3 value='' class=actions onclick='onActionMultiselectCheckboxClick(this)'> </td> <td nowrap class="doclistlocicon"> <div class='lockiconemptyspace'/> </td>
28
14
<input type=checkbox id=actionmultiselectcheckbox_2 value='' class=actions onclick='onActionMultiselectCheckboxClick(this)'> </td> <td nowrap class="doclistlocicon"> <span title=''><img width=16 height=16 class=defaultRepositoryLockIconStyle src='/webtop/wdk/theme/documentum/icons/indicator/ i_locked_by_you_16.gif' border=0 alt=''></span> </td>
Copyright 2008 EMC Corporation. All rights reserved. 29
<input type=checkbox id=actionmultiselectcheckbox_4 value='' class=actions onclick='onActionMultiselectCheckboxClick(this)'> </td> <td nowrap class="doclistlocicon"> <span title=''><img width=16 height=16 class=defaultRepositoryLockIconStyle src='/webtop/wdk/theme/documentum/icons/indicator/ i_locked_by_another_16.gif' border=0 alt=''></span> </td>
Copyright 2008 EMC Corporation. All rights reserved. 30
15
Selection Lists
When performing an action against an object, a selection list is sent that indicates which object on the page the action is to be performed against For example, this selection list indicates:
There are twenty objects on the page The twelfth one will be the target of the action The action is checkout "Name=__dmfHandlerArgs", "Value=HomeCabinet_0_action=checkout&selection=00000000000100000000", ENDITEM,
In order for this checkout to be successful, the object at that position MUST be in the correct state
Must be a document, not a folder Must be unlocked
Sample scripts check to see if that document is in the right state prior to performing the checkout/checkin action (getLockedCount)
Copyright 2008 EMC Corporation. All rights reserved. 31
If users are checking out from a common area, find a way to separate them
Different document name for each user Different document in list Ensure that list size is large enough for all users performing operation or perform search to identify document to checkout/checkin
As checked out files will be downloaded to the disk on the load generator machine, be sure to assign specific vusers to specific controllers to ensure that a checked out file can be found where expected
32
16
LoadRunner scripts will continue to execute even when a previous page contained an error Instead of getting the page you requested, you might get:
An error has occurred History released
33
WDK applications will force you to click to a new page to get the full error
LoadRunner scripts cant do that unless you explicitly code it!
To see the stack trace, look at the wdk.log file on the application server Common causes:
Passing invalid or null data to a component Two users colliding on a single object
34
17
History Released
Previous attempt to store the dmfRequestId failed, so invalid data is sent on next URL
Solution:
Verify in the extended logs that the dmfRequestId being sent is valid
35
Turn on extended logging, with client request and server response Open output.txt from script directory in an external editor to aid in debugging Search for strings that indicate what the problem is
is not a parameter An error has occurred backdetector.jsp prompt.jsp
36
18
If possible, enable just-in-time logging, max size 100 Search for same phrases in user logs Investigate errors in wdk log files
37
19
40
20
To get application logs outlining APIs sent, data received and show APIlevel errors, turn on DMCL tracing Should only be run in single-user mode unless problem is only visible in multi-user tests To turn on:
https://<hostname>:<port>/<appname>/wdk/dmclTrace.jsp?level=10
To turn off:
https://<hostname>:<port>/<appname>/wdk/dmclTrace.jsp?level=0
File is created on application server at path shown in response Developers can analyze the trace file for issues and errors
41
The UCF invoker must be running and return a UID value >= 0, otherwise it will hang or return an error Causes:
UCF invoker is not running Path to TdfUCFInvokerClient.dll is not correct in vuser_init section UCFWin32JNI.dll is not in search PATH (copy it from the UCF client bin directory to the UCF Invoker directory if it does not exist) Incorrect JSESSIONID is passed as argument to getUID function
Check UCF Invoker logs for errors indicating the source of the problem
42
21
Issue:
Script recorded against one docbase, and played back against another, OR Repository structure has been changed or rebuilt
Cause:
Script will have hard-coded r_object_id values that are no longer valid
Solution:
Parameterize all r_object_id values in the script
43
Issue:
Script worked fine until a small change was made in the application code
Cause:
Application code has introduced new or modified URLs that are not in original script, or Application code has modified a pattern that is parameterized and used elsewhere
Solution:
Identify the source of the change and update the script to reflect it
44
22
Problem:
The script runs without fail in a single user environment, but many users fail in multiuser runs
Cause:
It is likely that there is some contention in a shared area, and multiple users are trying to work on the same item
Solution:
Wherever possible, architect the tests so that each user has their own sandbox Ensure that vusers run on specific load generators to ensure that checked out files will be available for checkin operations
45
Problem:
When the user exports the file to disk, it works the first time, but fails in subsequent tests
Cause:
A file with the same name already exists in the export folder, and WDK prompts you to overwrite the file
Search extended logs for prompt.jsp
Solution:
Before exporting a file, have the virtual user try to delete it first
46
23
Problem:
A script recorded in one step has been broken down into multiple actions to allow for a single login/logout and repeated iterations of the core activity
Cause:
1. The core activity does not start and end from the same WDK location. 2. The dmfRequestId and SerialNumber values are not valid 3. OldFolderPath or PageIndex have not been updated properly
Solution:
Ensure that the starting and ending location is the same (ie. Cabinets view or Inbox) Record the last values of each frames dmfRequestId, SerialNumber, OldFolderPath and PageIndex and replace them at the beginning of the action
47
Problem:
When simulating occasional users with long pacing times, users fail when beginning a new iteration
Cause:
User sessions may be released due to session timeout.
Solution:
Depending on transaction pacing and think time used in the scripts, you might have to increase the session timeout located in WEB-INF/web.xml as well as in application server
48
24
Problem:
Load Runner script works using VuGen but fails in controller.
Cause:
Wrong protocol for replay, or Load Generator not properly configured with files, folders, UCF invoker, SSL certificates
Solution:
Make sure "WinInet replay instead of Sockets (Windows only)" is turned off. Make sure UCF Invoker is running and configured properly on all load generators Be sure to run createsourcefiles.bat if running the kit
49
Problem:
After a number of tests have been run, checkouts start to fail.
Cause:
It could be that all the documents are already checked out and there are none available for checkout.
Solution:
Capture information before checkout to make sure that checkout is possible before invoking step Unlock all documents between tests to clean up any locked docs to start clean
50
25