Having problems with your account or logging in?
A lot of changes are happening in the community right now. Some may affect you. READ MORE HERE

Is it possible to break a page-based web script into multiple transactions without losing session information?

Is it possible to break a page-based web script into multiple transactions without losing session information?

In general it is not recommended to split web scripts into multiple transactions when you want to simulate a single user session as, by default, the replay engine simulates a browser shutdown at the end of each transaction thus mimicking real life. Instead you should record each user story (e.g user who browses and searches, or user who searches and buys) as a succinct transaction. If you want to break down specific areas of functionality you should do this through the use of functions in bdh files.


Nevertheless, there are occasions when you may want to separate functionality out into separate transactions, e.g. you may not want each user to log into the application each time as you are not interested in testing this specific functionality. in these cases you can maintain session information across transactions if you follow the following rules.

1. Break the script into transactions during the record process.
To do this use the New Transaction button in the recorder. Creating new transactions during record will ensure that cookies etc are set appropriately in each transaction.

NB If you break the script into multiple transactions manually, after recording a single transaction, then you will almost certainly lose session information.

2. Uncheck Choose transactions randomly
This will ensure that the transactions are run in the appropriate order. This setting is found in
Settings | Active Profile | Replay | Simulation | Simulation tab

3. Disable Simulate user behavior for each transaction
By default this setting is enabled. When enabled, the replay engine simulates a browser shutdown between transaction clearing the cache and cookie database for each user. This setting is found in:
Settings | Active Profile | Replay | Web | Simulation tab

If the multiple transaction script continues to fail it is worth recording and replaying as one transaction to determine whether this is having an effect.

 

Inserting a “New Transaction” via the Recorder results in cookies hard-coded into each transaction to maintain state / context between transactions.

 

If the user behavior is disabled (as suggested in 3 above) then some / all of the scripted WebCookieSet calls may be removed.  First compare with a script recorded in a single transaction after clearing the browser cache and cookies – if the cookie does not occur then you should be safe to remove it.  

DISCLAIMER:

Some content on Community Tips & Information pages is not officially supported by Micro Focus. Please refer to our Terms of Use for more detail.
Top Contributors
Version history
Revision #:
1 of 1
Last update:
‎2013-02-15 18:58
Updated by:
 
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.