Professional Documents
Culture Documents
ORACLE NCA Tips & Tricks
ORACLE NCA Tips & Tricks
NOTE: LoadRunner does not support anything between Oracle Forms 5.x and Forms 6.0.8.7.x It is HIGHLY recommended that you download the latest Oracle NCA patch for the LoadRunner version that you are using from Customer Support website
NOTE: LoadRunner supports Oracle Forms server running in any mode (Socket, HTTP, HTTPS). LoadRunner also supports forms listener servlet enabled applications for HTTP and HTTPS mode. For NCA/WEB application, please refer to Problem ID 12538 - How to record and replay Multi Protocol (NCA/WEB) Vusers
c.
d. On the Find System Profile Values window, 1. Check the Site Checkbox 2. Check the User Checkbox and specify the desired user logon 3. Uncheck Profiles with No Values and specify %ICX%Launch% on the textbox for Profile\ 4. Click on find
e. On the System Profile Values window Look for the ICX: Forms Launcher Profile Update the user value to include ?play=&record=names EXAMPLE: Change from http://oracleapps:1111/dev60cgi/f60cgi To http://oracleapps:1111/dev60cgi/f60cgi?play=&record=names
f. Save the changes and exit the application. g. Sign on again via Personal Home page using the username and this setup will be enabled.
Set the record=names flag through Web CGI configuration file and startup HTML file
a. Steps to verify which server files need to be modified: Record a Winsock script against the Oracle Forms application. After logging into the application, stop the recording. Go to the data.ws file. Search for ".cfg" without the quotes (") from the beginning of the data.ws file. You should come to a section that looks like the following: "<HTML>\n" 7
"<!-- $Header: appsbase.htm 115.18 2003/02/17 04:15:03 smaradan ship $ -->\n" "<!-appsweb.cfg 115.121 -->\n" "<HEAD>\n" "<TITLE>Oracle Applications 11i </TITLE>\n" "</HEAD>\n" You need to make the changes to the files mentioned as shown above. In most cases it's appsbase.htm and appsweb.cfg. In other cases, it may be basejini.htm and formsweb.cfg. The Winsock recording will contain this information. b. Modify the Forms Web CGI configuration file Bring up the Forms Web CGI configuration file. This is the cfg file identified from step (a) Add xrecord=names to anywhere in the file. Mercury recommends you to append it to the end of Values for the Forms applet parameters section. EXAMPLE: Refer to Appendix 1 for sample FORMSWEB.CFG file.
c.
Modify the startup HTML file Bring up the startup HTML file. This is commonly known as basejini.htm Look for the line with <PARAM NAME="serverArgs" Append record=%xrecord% to the end of it. EXAMPLE: <PARAM NAME="serverArgs" VALUE="module=%form% userid=%userid% %otherParams% record=%xrecord%"> NOTE: There are multiple occurrences of serverArgs make sure you append the flag at the end of each occurrence. EXAMPLE: Refer to Appendix 2 for sample basejini.htm file
set_window( "Objects"); lov_retrieve_items("Objects",1,14); lov_select_item("Objects","AP_CARD_NOTIFICATIONS"); /* Example on handling pop up window: You need to put the title of the window inside the obj_status function. Also, you need to put the error handling statement below wherever the popup may occur. */ int status; status=obj_status("Error"); if (status = = 0){ popup_message_press("Error","OK"); /*Sometimes instead of the function popup_message_press another function named message_box_press is needed to click on a button and close the window. To find out which function is suitable for you, simply record a script that generates that popup window, click on a button on it, and see which function was recorded. */ // message_box_press("Forms",1);
NOTE: In LoadRunner 7.6 or above, there are more supported properties such as sys_url, object_checked, and etc. Please check the function reference for a full list of supported properties.
10
Using edit_get_text
If the value does not appear in one of the objects above, then you should use the edit_get_text function. EXAMPLE: char val[10]; edit_set("FNDSCSGN.SIGNON.USERNAME.0","SYSADMIN"); // The following line will capture the value from an edit field. edit_get_text("FNDSCSGN.SIGNON.USERNAME.0",val); // The following line will output the value of the variable val into the execution log. lr_output_message("The username is %s", val);
From the above code, you will see that a request has been submitted. Afterwards, the Refresh Data button is pressed to query for the status of the request. The status appears in the Phase column Problem: The fields cannot be clicked on, and therefore nothing is recorded when you click on it. Solution: i. Retrieve the Object ID from the "Phase" status column and find out whether it is "Inactive" or "Active". a. Put the cursor at the beginning of the execution log, and then search for "Inactive". If you do not find it, then search for Active. Search until it looks the Inactive/active data is something returned from either the "Submit Request" step above or the "Refresh Data" step. Action1.c(42): property=137 type=0x4000 value="Inactive" b. If you look above this line, you will see that there is a handlerID. This handlerID is equivalent to the ObjectID in Oracle NCA, and therefore this unique ID is needed. Action1.c(42): Server Message Properties: action=2 handlerClassId=0x101 handlerId=397 Action1.c(42): property=137 type=0x4000 value="Inactive" ii. The line number within the ( ) in the execution log that contains the handlerID also indicates which line of the script is returning the value. From the above sample, it appears that line 42 is returning the value for the phase column. Go to line 42 of the script and you should see something similar to the following: button_press("FNDRSRUN.WORK_ORDER.SUBMIT.0"); iii. Use the edit_get_text function to retrieve the values EXAMPLE: char value[25]; button_press("FNDRSRUN.WORK_ORDER.SUBMIT.0"); edit_get_text("397", value); lr_output_message ("The phase of Journal Import is %s", value);
How to deal with Warning: did not reply to property 402 warning message
Problem: Replay is failing and in the execution log we see the following warning: Warning: did not reply to property 402 Solution: Use the function nca_java_set_reply_property( ); to reply to the Java object.
12
i. Replay the script with extended logging and look for the first occurrence of the error (Warning: did not reply to property 402) in the execution log. Above the error you will see the server request.
Action.c(68): Server Message Properties: action=4 handlerClassId=0x10F handlerId=28 Action.c(68): property=402 type=0x4000 value="MercuryEnabled" Action.c(68): Warning: did not reply to property - 402
ii. Go to the script directory and open the file nca_record.log (for LR 7.6 and above) or record.log (for LR 7.51 SP1 and below). a. Look for the first occurrence of the entire server request. In this example the search string is:
Server Message Properties: action=4 handlerClassId=0x10F handlerId=28
Below this in the recording log you should see the Client response.
Client Message Properties: action=4 handlerClassId=0x10F handlerId=28 property=402 type=0x4000 value="TRUE" Client Terminate Message: #6
b. Search for the next occurrence of the same server request in the recording log. Below is the next occurrence:
Server Message Properties: action=4 handlerClassId=0x10F handlerId=28 property=402 type=0x4000 value="message" Server Terminate Message: #7
Below this in the recording log you should see the Client response.
Client Message Properties: action=4 handlerClassId=0x10F handlerId=28 property=402 type=0x4000 value="Unknown property: BACKGROUND" Client Terminate Message: #8
c. Search for all the occurrences of the server request from the recording log and note the value of the server request and client response. If you see the same request and response you only need to note it once. d. Search in the recording log for the first occurrence of the handlerId. In this example its handlerId=28. Note the value of property=129 because this is the object name and is needed.
Server Message Properties: action=1 handlerClassId=0x10F handlerId=28 property=134 type=0x7000 value=18 property=135 type=0xA000 value=Point [x=0,y=0] property=137 type=0xA000 value=Point [x=0,y=0] property=129 type=0x4000 value="CONTROL_MERCURY_CLIENT_0" property=397 type=0x4000 value="MERCURYClientBean"
e.
13
Char *<variable>[][] = { {<object name of handlerId>, <server request value>, <client response value>}, {<object name of handlerId>, <server request value>, <client response value>}, {<object name of handlerId>, "", ""}}; char * JavaProp[][] = {{"CONTROL_MERCURY_CLIENT_0", " MercuryEnabled ", "TRUE"}, {" CONTROL_MERCURY_CLIENT_0", "message", "Unknown property: BACKGROUND"}};
f. Insert the the nca_java_set_reply_property function into the script above the nca_connect_server statement.
nca_java_set_reply_property(JavaProp); nca_connect_server();
Note: For more information and examples on how to use this function refer to the LoadRunner 8.0 Function Reference
Appendixes
14
height=684 separateFrame=false splashScreen=no ; select default background by not specifying a value background= lookAndFeel=Oracle colorScheme=teal ; serverApp=default serverApp=forecast serverPort=9001 serverHost=easgdev1.dats.ml.com connectMode=socket archive=f60web.jar archive_ie=f60all.cab
xrecord=names
; 4) Parameters for JInitiator ; Page displayed to Netscape users to allow them to download JInitiator. ; If you create your own version, set this parameter to point to it. jinit_download_page=/jinitiator/us/jinit_download.htm ; Parameters related to the version of JInitiator. jinit_classid=clsid:a2001dd0-c7bd-11d4-a3e1-00c04fa32518 jinit_exename=jinit1183.exe#Version=1,1,8,3 jinit_mimetype=application/x-jinit-applet;version=1.1.8.3 ; jinit_classid=clsid:7d0314a8-7851-11d4-a3e1-00c04fa32518 ; jinit_exename=jinit.exe#Version=1,1,7,31 ; jinit_mimetype=application/x-jinit-applet;version=1.1.7.31 ; ******************************** ; SPECIFIC CONFIGURATIONS ; ******************************** ; You may define your own specific, named configurations (sets of parameters) ; by adding special sections as illustrated in the following examples. ; Note that you need only specify the parameters you want to change. The ; default values (defined above) will be used for all other parameters. ; Use of a specific configuration can be requested by including the text ; "config=<your_config_name>" in the query string of the URL used to run ; a form. For example, to use the sepwin configuration, your could issue ; a URL like "http://myhost.mydomain.com/ifcgi60.exe?config=sepwin". ; Example 1: configuration to run forms in a separate browser window with ; "generic" look and feel (include "config=sepwin" in the URL) [sepwin] separateFrame=True lookandfeel=Generic ; Example 2: configuration affecting users of MicroSoft Internet Explorer 5.0. ; Forms applet will run under the browser's native JVM rather than 16
; using Oracle JInitiator. [ie50native] IE50=native ; Example 3: configuration forcing use of the base.htm base HTML file in all ; cases (means applet-style tags will always be generated and ; JInitiator will never be used). [applet] baseHTMLJInitiator= ; Example 4: configuration to run the demos ; PLEASE DO NOT REMOVE THIS EXAMPLE, ! ; It is needed to run the Forms demos (if they are installed) [demo] pageTitle=Oracle Forms Server Demos width=700 height=550 form=start60 userid=%Demos_ConnectString% archive=f60all.jar, oracle_ice-4_03_1.jar serverApp=/forms60demo/demo lookAndFeel=oracle colorScheme=teal ; [jini118] jinit_download_page=/jinitiator/us/jinit_download.htm ; Parameters related to the version of JInitiator. jinit_classid=clsid:a2001dd0-c7bd-11d4-a3e1-00c04fa32518 jinit_exename=jinit.exe#Version=1,1,8,3 jinit_mimetype=application/x-jinit-applet;version=1.1.8.3 [v0] serverApp=f_test serverport=9002
17
<PARAM NAME="splashScreen" VALUE="%splashScreen%"> <PARAM NAME="background" VALUE="%background%"> <PARAM NAME="lookAndFeel" VALUE="%lookAndFeel%"> <PARAM NAME="colorScheme" VALUE="%colorScheme%"> <PARAM NAME="serverApp" VALUE="%serverApp%"> <COMMENT> <EMBED SRC="" PLUGINSPAGE="%jinit_download_page%" TYPE="%jinit_mimetype%" java_codebase="/forms60java/" java_code="oracle.forms.engine.Main" java_archive="%archive%" WIDTH="%Width%" HEIGHT="%Height%" HSPACE="0" VSPACE="0" serverPort="%serverPort%" serverHost="%serverHost%" connectMode="%connectMode%" serverArgs="module=%form% userid=%userid% %otherparams% record=%xrecord
%"
separateFrame="%separateFrame%" splashScreen="%splashScreen%" background="%background%" lookAndFeel="%lookAndFeel%" colorScheme="%colorScheme%" serverApp="%serverApp%" > <NOEMBED> </COMMENT> </NOEMBED></EMBED> </OBJECT> <!-- Forms applet definition (end) --> %HTMLafterForm% </BODY> </HTML>
19