Tuesday, June 11, 2013

ORACLE NCA protocol

This is part 1 of an article which discusses some of the mechanisms for performance testing Oracle Applications / Oracle Forms using LoadRunner. This is far from an in-depth article but will, we hope, help performance testers get started with testing Oracle Applications and act as a reference resource. The article as a whole covers two key areas that seem to present the most issues, Object Names and Connect issues, as well as some other issues that we at Testing Performance have come across when delivering our Performance Testing Services. Part 1 covers Object Names issues.

Object Names

One of the first issues you will come across when recording an Oracle Application is that Oracle objects are recorded by a number rather than a name. These numbers are dynamic and cannot be relied upon when playing back a script, i.e. the object cannot be found by LoadRunner as its “number” has changed.

Here is an example of objects recorded by their object number (this is part of a login script that was recorded using Oracle Applications 11i protocol against an Oracle Forms application):

nca_edit_set(“31”, ”USERNAME”);

nca_obj_type(“31”, ‘\t’, 0);

nca_edit_set(“32”, (”PASSWORD”));

nca_obj_type(“32”, ‘\t’, 0);

nca_edit_set(“33”, ”TRAINING”);

nca_button_press(“34”);


This script refers to four objects 31, 32, 33 and 34. If these objects do not change their number between recording and execution then the script should run OK. However these numbers are subject to change for example if a new field is added on the form between object 33 and object 34 then the nca_button_press(“34”) would fail as would now probably known as 35. To get round this issue Oracle offers the “RECORD=NAMES” method which associates a name to each object rather than a number. The name is very much more likely to remain static.

Here is the same example as above except the objects were recorded by their object name (this is part of a login script that was recorded using Oracle Applications 11i protocol against an Oracle Forms application):

nca_edit_set(“LOGON_INFO_USER_NAME”, ”USERNAME”);

nca_obj_type(“LOGON_INFO_USER_NAME”, ‘\t’, 0);

nca_edit_set(“LOGON_INFO_USER_PASSWORD”,(”PASSWORD”));

nca_obj_type(“LOGON_INFO_USER_PASSWORD”,(””, ‘\t’, 0);

nca_edit_set(“LOGON_INFO_USER_DATABASE”,(””,”TRAINING”);

nca_button_press(“LOGON_INFO_CONNECT_BUTTON”);
....
By default, in all the engagements that I have been involved in at least, Record=Names is not enabled. So how do you enable Record=Names? Here are four methods for achieving this, three of which require a configuration change and one which is very simple. I have found that finding the correct method is very much a “suck it and see” methodology.

Before trying the following just make sure that your installation records numbers instead of names by recording a simple logon script.

Method 1: Append to URL 

This is very much the simplest method and should be tried first.

Below is the Start Recording dialog presented when recording using the Oracle Applications 11i protocol. The URL in this case is:

http://apps.acme.co.uk:7778/forms/frmservlet?config=2001

Try appending record=names to the end of the URL, for example:

http://apps.acme.co.uk:7778/forms/frmservlet?config=2001&record=name

Note if record=names is the first parameter to be added to the url then you will need a question mark before it eg:

http://apps.acme.co.uk:7778/forms/frmservlet?record=names

If however there are one or more parameters already in the url then you will need the ampersand prefix eg:

http://apps.acme.co.uk:7778/forms/frmservlet?config=2001&record=names
Now try and record a simple login script, if the object numbers are replaced by object names then you are in business. You should also notice that the record=names flag is appended to the connect_server statement.

Note: This method worked with the following configuration:
Oracle Forms version: 1012002

LR Protocol: Oracle Applications 11i

LR Version: 9.5

Jinitiator version: 1.3.1.28 (not overly important)

Method 2: Set record=names in startup file


This method requires a change to the HTML startup file on the forms server. Tracking which file to change can be a bit tricky if someone has renamed the appropriate file, which they are quite entitled to do. The file you are looking for is the one that is called when the forms applet starts. This file holds configuration details for the forms applet. By default the name of the file is basejini.htm.

The file contains a number of configuration entries. The line you are interested in is something like this:

[param name="”serverArgs" fndnam="APPS”" /] Note there may be a number of entries which replace the ellipses (…) above.

Append record=names as the last argument i.e.: [param name="”serverArgs" fndnam="APPS" record="names”" /]

>

Note: there is a space between the fndnam=APPS argument and record=names.

Now try and record a simple login script, if the object numbers are replaced by object names then you are in business. Note: This method worked with the following configuration:

Oracle Forms version: 60824

LR Protocol: Oracle Applications 11i

LR Version: 9.5
Jinitiator version: 1.1.8.16 (not overly important) 

Method 3: Set value in formsweb file and HTML start-up file 

I have had to use this method less often than the previous two methods. This method should be used if the HTML start-up file references the Forms CGI configuration file. This method requires two files to be changed.

The Forms CGI configuration file in question is formsweb.cfg (it may have been renamed but probably not).

You will need to add a new entry in this file under the USER PARAMETERS in the section: “Values for Forms applet parameters”. Add the following as the last entry in this section:

xrecord=names

Your file should look something like this:

connectMode=socket

serverHost=serv1.acme.co.uk

xrecord=names
;
4) Parameters fo Jinitiator

In the HTML start-up file basejini.htm (or whatever its name has been changed to) there are a number of configuration entries. The lines you are interested in go something like this:

[param name="”serverArgs" fndnam="APPS”" /] Note there may be a number of entries which replace the ellipses (…) above.

Append record=%xrecord% as the last argument i.e.: [param name="”serverArgs" fndnam="APPS" record="%xrecord%”" /]

Note 1: there is a space between the fndnam=APPS argument and record=%xrecord%.

Note 2: there may be more than one entry in the HTML start-up file that needs to be changed

Method 4: Oracle Applications record=names flagoracle nca pop up handle:
We will see step-by-step procedure of how to handle the pop-up windows while using Oracle NCA protocol: 
Put the title of the pop-up window in nca_obj_statusfunction.
Find out where the pop-up is occurring, put the handling statement below it.
The handling statement could benca_popup_message_press or nca_message_box_press.To find out which function is suitable for your script, record a script using data that generates that popup window, click on the button and check which function gets recorded.

Example:

This piece of code will trigger a pop-up:


nca_set_window( "PopUpObjects");

nca_lov_retrieve_items("PopUpObjects",1,20);

nca_lov_select_item("PopUpObjects","POP UP NOTIFICATIONS");
If title of the window is “Warning”, put it inside the nca_obj_status function. The code would be something like-

int status;

status=nca_obj_status("Warning");

if (status = = 0)

nca_popup_message_press("Warning","OK");

// nca_message_box_press("Forms",1); Any one of them