Loop and virtual users

Verification points can fail during a run if virtual users in loops lose their original state. To enable each virtual user to enter the loop in the original state, you can...

By default, the cookie cache for a virtual user is not reset during a test run. This is consistent with a browser's behavior. If a test or schedule contains loops, and a web server sets a cookie during the first iteration of the loop, that cookie is "remembered" on subsequent iterations.

However, in certain instances, you might want to clear all cookies cached for a particular virtual user. For example, if you want each iteration of a loop to appear as a new user, you must reset the cache. If you do not, although the test completes, verification points that you have set within the test may fail.

There are two ways to reset the cookie cache...


clearCookieCache

The lines you add to the generated custom code template are bolded.

package test;

import com.ibm.rational.test.lt.execution.http.util.CookieCacheUtil;
import com.ibm.rational.test.lt.kernel.services.ITestExecutionServices;

public class Class1131739398417 implements
        com.ibm.rational.test.lt.kernel.custom.ICustomCode2 
{
        
    public Class1131739398417() 
    {
    }

    public String exec(ITestExecutionServices tes, String[] args) 
    {
        CookieCacheUtil.clearCookieCache(tes);
        return null;
    }
 }

See also: Clear cookies for a virtual user.


Related:

Redirection support for HTTP tests
HTTP test editor overview
Cut and paste in tests
Specify the number of allowable URL redirects during test runs
Define performance requirements in tests
Add an authentication folder
Verify expected behavior
Specify error-handling behavior
Split a test
Split a test page
Merge test pages
Disable and enable secondary HTTP requests
Reuse tests on different hosts: Server connection variables
Convert tests to use SSL connections
View a test in the Protocol Data view
Test Siebel applications
Run tests at a set rate
Repeat tests in a schedule
Add a loop to a test


Error 404 - Not Found

Error 404 - Not Found

The document you are looking for may have been removed or re-named. Please contact the web site owner for further assistance.