web.utilSetRequestUrl

Asynchronous Functions - JavaScript

Sets a string to be the request URL for the next request sent in the ConversationClosed An Asynchronous Conversation is a series of related web tasks, including tasks caused by redirection. An Asynchronous Conversation starts with the request for the desired response, includes all the requests and responses that are caused by this request (authentication, redirection, and so on) and ends when the desired response is received or when the series of interactions is canceled..

Syntax

 web.utilSetRequestUrl ( <urlStr> );
Argument Description
aUrlStr

The string to be set as the absolute URL for the new request. For example, http://www.site.com/bin/cgi.exe?a=b

Do not pass a URL-encoded string.

Return Values

Not applicable

Parameterization

All input arguments can be parameterized using standard parameterization.

General Information

This is a utility function that can be called from the callback routine Request Callback.

It encodes the string for URL, and passes the string with spaces and special characters. If you pass a URL-encoded string, it may be unusable after the encoding is applied to an already encoded string.

Example

web.utilSetRequestUrl("http://myserver/mypath.htm");

Example: Asynchronous Conversations

Copy code
//Automatically generated file for implementing asynchronous callback functions.
//You can modify the automatically generated callback implementations or add new ones.
//Asynchronous callback functions can be registered using web_reg_async_attributes steps.
            function Push_0_RequestCB()
            {

            lr.outputMessage(">>> Push_0_RequestCB");

            }

            function Push_0_ResponseHeadersCB(
            aHttpStatusCode,
            aAccumulatedHeadersStr,
            aAccumulatedHeadersLen)
            {
            //Enter your implementation for ResponseHeadersCB() here.

            lr.outputMessage(">>> Push_0_ResponseHeadersCB " + aHttpStatusCode + " / " 
            + aAccumulatedHeadersStr.substr(0, 10) + " / " 
            + aAccumulatedHeadersLen);

            }

            function Push_0_ResponseBodyBufferCB(
            aLastBufferStr,
            aLastBufferLen,
            aAccumulatedStr,
            aAccumulatedLen,
            aHttpStatusCode)
            {
            //Enter your implementation for ResponseBodyBufferCB() here.

            lr.outputMessage(">>> Push_0_ResponseBodyBufferCB "  + aLastBufferStr.substr(0, 20) 
            + " / " + aLastBufferLen + " / " + aAccumulatedStr.substr(0, 20) 
            + " / " + aAccumulatedLen + " / " + aHttpStatusCode);

            }

            function Push_0_ResponseCB(
            aResponseHeadersStr,
            aResponseHeadersLen,
            aResponseBodyStr,
            aResponseBodyLen,
            aHttpStatusCode)
            {
            //Enter your implementation for ResponseCB() here.

            //TODO - To make the script wait for a specific response, use web_sync in the relevant Action file.
            //See the Modifying Callbacks section in the VuGen Help Center for more details.
            lr.outputMessage(">>> Push_0_ResponseCB " + aResponseHeadersStr.substr(0, 20) + " / " 
            + aResponseHeadersLen + " / " + aResponseBodyStr.substr(0, 20) + " / " 
            + aResponseBodyLen + " / " + aHttpStatusCode);

            }


            function Action()
            {

            web.regAsyncAttributes(
            {
            id: "Push_0",
            pattern: "Push",
            url: "http://myserver.abc.com/cgi-bin/nph-pushJS_FF.exe",
            //requestCB: =Push_0_RequestCB",
            responseHeadersCB:    'Push_0_ResponseHeadersCB',
            responseBodyBufferCB:
            function Push_0_ResponseBodyBufferCB(
            aLastBufferStr,
            aLastBufferLen,
            aAccumulatedStr,
            aAccumulatedLen,
            aHttpStatusCode)
            {
            //Enter your implementation for ResponseBodyBufferCB() here.
            lr.outputMessage(">>> Push_0_ResponseBodyBufferCB " + aLastBufferStr.substr(0, 20) 
            + " / " + aLastBufferLen + " / " + aAccumulatedStr.substr(0, 20) 
            + " / " + aAccumulatedLen + " / " + aHttpStatusCode);
            }
            });

            web.url(
            { 
            name: "push_to_iframe_new_object_FF.html",
            url: "http://myserver.abc.com/webgui/push/push_to_iframe_new_object_FF.html",
            resource: "0",
            recContentType: "text/html",
            snapshot: "t1.inf",
            mode: "HTML",
            });
        

            lr.thinkTime(30);
            web.stopAsync("Push_0");    

            return 1
            }