Friday, 28 February 2014

Unable to replay NCA script

Problem detail:  when replay the Oracle-NCA script, after executing following coldes,it hangs and keeps sending heart beat request.
**************************
nca_step_begin();
nca_java_action("CS_FIND_CONTRACT_GRID_ITEM_GRID_0", "resourceRequest", "resources==[29]JTF_GRID_EXPORT_PROGRESS_MESS[27]JTF_GRID_EXPORT_IN_PROGRESS[30]JTF_GRID_FIND_IN_PROGRESS_MESS[25]JTF_GRID_FIND_IN_PROGRESS[28]JTF_GRID_PRINT_PROGRESS_MESS[26]JTF_GRID_PRINT_IN_PROGRESS[28]JTF_GRID_POPUP_COPY_ALL_ROWS[24]JTF_GRID_POPUP_COPY_CELL[28]JTF_GRID_POPUP_COPY_SEL_ROWS[19]JTF_GRID_POPUP_FIND[19]JTF_GRID_POPUP_GOTO[22]JTF_GRID_POPUP_REFRESH[19]JTF_GRID_POPUP_SORT[30]JTF_GRID_HPOPUP_CUSTOMIZATIONS[24]JTF_GRID_HPOPUP_HIDE_COL[27]JTF_GRID_HPOPUP_OPEN_CUSTOM[27]JTF_GRID_HPOPUP_SAVE_CUSTOM[30]JTF_GRID_HPOPUP_SAVE_CUSTOM_AS[28]JTF_GRID_HPOPUP_CLEAR_CUSTOM[29]JTF_GRID_HPOPUP_SHOW_ALL_COLS[24]JTF_GRID_HPOPUP_SHOW_COL;");
nca_java_action("CS_FIND_CONTRACT_GRID_ITEM_GRID_0", "msgRequested", "");
nca_step_end();

lr version: 11.03

Problem Solution: Changing the NcaTimerWaitMode will delay the replay engine in searching for the item in case there is an active timer. This is disabled by default as it is not required in most of the cases. The NcaTimerWaitMode can be changed under the [NCA_GENERAL] section in the default.cfg file located under the script folder.

NcaTimerWaitMode=<value>
where "value" is number from 0 to 3.

NcaTimerWaitMode=0 The timer expired message is kept in the client message queue until next client terminate message. If an NCA replay function started its object search, but the object was not found and there is active timer in the system, replay waits for timer expiration, flushes the message queue by client terminate messages, and after an answer from a server, tries to find required object.

NcaTimerWaitMode=1 When the NCA replay function is called and there is active timer in the system, always wait for its expiration, flush the message queue, and only then try to find the required object. This mode is useful when a required replay object already exists (no error on this step), but some requested data or form is not ready yet.

NcaTimerWaitMode=2 When a client receives the timer schedule message, it just waits for requested time, generates an expired message, and sends it immediately. There are no messages between the server and client in this case.

NcaTimerWaitMode=3 Differs from mode 1 by immediate message queue flush when an expired message is generated. This mode may be useful when there is no message flush due to NCA replay function execution.
Example:
The nca_get_top_window function is called in a script. This function does not produces client messages, so, cannot flush message queue.

Note: The default timer mode in LoadRunner 8.1 onward is set to 3. Hence, NcaTimerWaitMode=3 specifies the default mode in LR 8.1 and newer versions.

Related articles:
Document ID 11913 - How-to and troubleshooting guide for Oracle NCA Vusers
Document ID 12538 - How-to and troubleshooting guide for Multi Protocol (NCA/WEB) Vusers

13 comments: