How can I customize Session ID"s using the SilkPerformer TrueLog Explorer? What is session Information and what is it used for? Due to the ever rising complexity of modern Web Applications, many now use dynamic data such as Session ID"s to maintain state or session between a client (e.g. Web Browser) and Server. The maintaining of session enables a Web Application to distinguish between multiple clients when the server is being accessed by multiple users in order to ensure that each individual client is served the expected Web Page. Session IDs are sent to clients in a number of ways. Most often they are included in cookies, hyperlink URLs, URLs of embedded objects, and HTML form fields. Likewise Session ID"s are returned to servers for subsequent client requests within cookies, URLs, and HTTP post. Typically session ID"s will take the form of a unique number, set of characters or a mixture of both. How does session Information affect replay in SilkPerformer? After the record process you will often see session information hard coded in the generated BDF script, either as part of a URL request or more commonly as a form value in the DCL Form section like so: The hard coded session values need to be customized if the BDF script is to replay successfully otherwise during Try-Script the Web Application will often return "Application Level" error messages such as "Session Timed Out" or "Application Error has occurred" among many others. The reason why "Application Level" errors will be thrown during Try-Script is because the same unique value which was sent by the server to the client during the record process cannot be reused when the BDF script is next replayed, therefore this unique value needs to be customized. Customizing Session ID"s using the TrueLog Explorer The TrueLog Explorer provides a "Customize Session Handling" Wizard that is accessible through the Workflow; this wizard allows you to identify session information by comparing the TrueLog generated during Try-Script to the Record TrueLog for any differences between values returned in the HTML source code. Once any differences are found the associated BDL script is also checked to see if it contains any occurrence of the highlighted value; if an occurrence is found in the BDL script then the value is flagged as a Session ID Candidate (by highlighting the value as Orange) and you are thus offered the opportunity to customise the value. The actual value is customized by the TrueLog Explorer by using left and right boundaries to capture the data which is returned by the server during each iteration of the BDF script and then assigning this captured data to a variable. The variable is then used to replace the hard coded session id value in the BDF script, so that during every iteration of the script the unique value returned by the server will be submitted by the client in order to maintain session. To customize Session ID"s using the TrueLog Explorer you will need to implement the following steps: Launch the TrueLog Explorer generated during a Try-Script Select "Customize Session Handling" from the Workflow and then select "Find Differences Use the "Step through Truelog" feature and press "Find Next" until some differences are found between the Record TrueLog and the Try-Script TrueLog Note that the highlighted data in the "In-data" tab is the dynamic session information which needs to be parsed. The highlighted value in the "Source Differences" tab can be customized by performing a double click action or by right-clicking and selecting "Customize Session Handling" Press "OK" to insert the parsing function into the BDF script, like so: The associated BDF script will now be modified so that it contains a function which is used to parse the Session ID from the server response, like so: and the variable containing the parsed dynamic Session ID will now be used to replace the hard coded value in the DCL form section, like so: Please Note: For further information on using the TrueLog Explorer to customize session information please refer to the "SilkPerformer TrueLog Explorer User Guide" under the section named "Customizing Session Handling - Identifying and Customizing Relevant Session Information For further detailed information on customizing session information please refer to the "Web Load Testing tutorial" under the sections "Comparing Record and Replay TrueLogs and Customizing Session Handling" Old KB# 17287
↧