SCL - Software and Services

Home Software Quality Software Testing News Testing Oracle Forms with Openscript

Testing Oracle Forms with Openscript

A Guide to using Oracle OpenScript to record a functional test with Oracle EBS/Forms

With the release of Oracle Application Test Suite (OATS) 9.00, comes a new scripting tool called OpenScript. It is based upon the popular Eclipse IDE, and allows users/testers to record testing scripts (both load and functional) for a number of popular technologies, including:

  • Oracle EBS/Forms
  • Siebel
  • Web

In this article we will concentrate on using OpenScript to record functional test with Oracle EBS/Forms.

(NOTE: For testing Siebel applications or Java applications in general see the blog written by Alex Amat).

The Forms Environment.

Before we can proceed with the testing the forms application, the first stage of this process involves making sure that the application can run from a normal web browser, and that the JInitiator environment is configured properly. First, you should install JInitiator.

We used the 10g (10.1.2.0.2) Demos environment for this white paper.

FIgure 1: The opening screen for the Oracle Forms Demo

 

NOTE : It is beyond the scope of this whitepaper to discuss the installation of the Oracle forms demo please visit http://www.oracle.com/technology/sample_code/products/forms/index.html and download the 10gR2 Demos package.

The operating system we will be using Microsoft Windows XP SP3 and, as OpenScript only supports Internet Explorer, a clean installation of Internet Explorer version 7.0.5730.13. A clean install of Internet Explorer is required because Oracle Forms does not work when certain plugins are installed on IE7 (See the Oracle forums for more information).

Stage 1- Install and configure JInitiator

(A) Installing JInitiator.

When you first invoke your Oracle Forms Application, and JInitiator is not installed, the browser will automatically invoke the installation of JInitiator. You should see a screen like this:

Figure 2: The JInitiator Install Screen

Choose the installation directory, and let the install complete. Once this has been done close your browser, and restart, and then specify the URL again. In this install, to get to demos screen this will be : http://apollo.scloffice.com:8889/forms/formsdemo/demos.html

Choose the appropriate URL for your installation.

(B) Changing the default JVM dll.

We found that, once the above steps have been completed, when you try to run the Forms demo, IE7 crashed. This issue has been documented on the Oracle forums. To fix, you should change the underlying jvm.dll - to do this you should download a suitable Sun JRE. We downloaded jdk1.5.0_16 JDK (which will contain the JRE client jvm.dll). Once this has been installed, you should copy over the jvm.dll to the relevant JInitiator directory. To do this:

  1. Open a cmd shell, and change directory to the JInitiator installation directory. In our case this was g:\program files\oracle\jinitiator 1.3.1.22
  2. Change directory to the bin directory. cd bin
  3. Within this directory you will find a hotspot directory. Change to this directory i.e. cd hotspot.
  4. Within this directory you should find two files Xusage.txt and jvm.dll.
  5. Copy the jvm.dll to a file called jvmoracle.dll copy jvm.dll jvmoracle.dll
  6. Copy the Sun jvm.dll to this directory copy g:\java\jdk1.5.0_16\jre\bin\client\jvm.dll . (Note the full stop to indicate the current directory)
  7. copy jvm.dll jvm15016.dll (so that we can have both JVMs which can be swapped, just copy the relevant JVM to jvm.dll and JIinitiator will pick it up)

Once this has been done restart the browser, and point it to the your application. You should now get a screen that looks like figure 3.

Figure 3: My Forms Application

(C ) Configuring the JInitiator

Once your application is running and you can successfully interact with it, we need to one final step before we talk about Oracle Forms and OpenScript. So go to Start -> Control Panel and click on the JInitiator 1.3.1.22 Icon. You should see a screen similar to figure 4. Make sure that the Show Java Console is enabled.

Figure 4: The JInitiator Control Panel

Once you have applied the Show Java Console setting, close the panel. Then restart IE7 and point it to your application. As well as your application showing up in your browser you should also see an extra window which looks similar to figure 5. We will be using this console window later on to make sure that OpenScript is recording interactions with the Oracle Forms Applet.

Figure5: The Java Console for JInitiator

Once all the above has been completed we can then move on to installing OpenScript, and setting up the environment so that OpenScript and Oracle Forms can communicate with each other.

Stage 2 - Installing OpenScript

Installing OpenScript is an easy process. Once you have the OpenScript installation program (available from http://www.oracle.com/technology/software/products/app-testing/index.html), unzip it to a suitable directory and you should be left with (at the time of this writing) a file called OpenScript900.exe. Execute this and you should see a screen similar to figure 5.

Figure 6: The Openscript Install Screen

Follow the instructions, making a note of the installation directory. Make sure all browsers are closed at this point. Once the installation has completed and the Launch OpenScript now has been enabled, you should see a screen similar to figure 7.

Figure 7: The OpenScript Welcome Screen

Once you have this screen you have successfully installed OpenScript. At this point close all browsers and close OpenScript. We still have a little more work to do.

Please read this before going to Stage 3

You will NOT need to perform Stage 3 if you have installed patch number 9042747. This patch fixes the underlyting jar file problem. The patch is available from metalink.oracle.com. Once logged in, goto Patches & Updates->Simple Search and type 9042747 into the Patch Number/Name field. Once you have downloaded this patch, unzip to a temporary directory, and run openScript900.exe. Choose Install  and let the installer finish. You should then be able to record your scripts. If you are unable to do this you will need to perform Stage 3. otherwise go to Stage 4.

Stage 3- Configuring OpenScript and Forms environment

One of the first problems that users usually run into is that they try to record an Oracle EBS/Forms script, and notice that OpenScript does not recognise any of the applet objects. This is because of an underlying jar file problem. The solution is to create your own jar file that will be downloaded to the browser which will contain all the class files that OpenScript needs in order to communicate with Oracle Forms objects.

Within the Oracle Forms environment, you will find a file called frmall_jinit.jar (which is downloaded to the browser whenever you run a forms application). We will be creating our own version of this which will include all the support classes that OpenScript needs.

The first step we need to do is to unjar (or unzip) the frmall_jinit.jar to a temporary directory. So we need to create a new directory for our new jar file. So

  1. Create a temp directory mkdir g:\temp\forms
  2. Copy over the frmall_jinit.jar to this directory copy g:\oracle\DevSuiteHome_1\forms\java\frmall_jinit.jar g:\temp\forms
  3. Change to this directory and use jar tool to unzip cd g:\temp\forms and g:\java\jdk1.5.0_16\bin\jar.exe xvf frmall_jinit.jar (This will create a file called forms.jar)
  4. Delete frmall_jinit.jar del frmall_jinit.jar

  5. We now need to copy all the supporting jar files to this directory. The list of jar files are :
    EBS11i_CrackedClass.jar
    fndaol.jar
    fndbalishare.jar
    fndctx.jar
    fndewt.jar
    fndforms.jar
    fndformsi18n.jar
    fndgantt.jar
    fndpromise.jar
    fndswing.jar
    fndtcf.jar
    fndutil.jar
    forms.jar
    jtfgrid.jar
    jtfscgnt.jar
    (These will be located within either the forms environment and/or the OpenScript environment e.g. g:\OracleATS90\OpenScript\OpenScript_configuration\org.eclipse.osgi\bundles\53\1\.cp\lib\formsClient\fndtcf.jar)
  6. Next we need to unjar each of these files individually, as my version of jar does not support wildcards i.e. g:\java\jdk1.5.0_16\bin\jar.exe xvf *.jar will not work so G:\java\jdk1.5.0_16\bin\jar.exe xvf fndaol.jar
  7. Repeat for each of the jar files.
  8. You will notice that two directories have been created. These are oracle and javax. These directories will contain all the classes needed for OpenScript. So to create our new frmall_jinit.jar we will execute jar cvf frmall_jinit.jar .\oracle .\javax
  9. Once this file has been created we need to install this into the forms environment. In our environment the original frmutil_all.jar file was located in g:\oracle\DevSuiteHome_1\forms\java. So we will rename this file (so as to keep the original) cd g:\oracle\DevSuiteHome_1\forms\java and
  10. copy frmall_jinit.jar frmall_jinit.jar.old
  11. copy g:\temp\forms\frmall_jinit.jar .

We now have a frmall_jinit.jar which will support OpenScript. (Note : By default, All forms applications will try to download supporting jar files from the Forms environment. In my instance these will be in the g:\oracle\DevSuiteHome_1\forms\java\oracle\apps\fnd\jar directory. We already have all the classes we need so we changed the name of this directory to g:\oracle\DevSuiteHome_1\forms\java\oracle\apps\fnd\jarold. This will cause an exception to be thrown at initialization (which you will see in the JConsole window) and will then carry on to download the frmall_jinit.jar)

Stage 4- Recording and playing a test script

  1. Run the OpenScript executable (Start->All Programs->Oracle Application Testing Suite->OpenScript in my environment).
  2. Click Goto OpenScript Workbench.
  3. Go to File->New and you should see a screen similar to figure 8.
    Figure 8: The OpenScript Oracle EBS/Forms selection
    Click Next
  4. You will then see (minus our own testing scripts in the Existing scripts list):
    Script Name
  5. Give the script a name. In this example we have formsTest. Then click finish.
  6. You will then be presented with the following screen :
    Script Recording
  7. Click the red record icon and you should see a browser window popup as well as the following :
    Figure 9: The Openscript WorkBench
  8. Type in the URL of your application into the browser in our case http://apollo.scloffice.com:8889/forms/formsdemo/demos.html
  9. Once your application is launched you should also see the JConsole window which contains important information as shown in figure 10. You will see some exceptions if you scroll through the information (e.g. FileNotFoundException etc), but most importantly you should see a bunch of cracked messages and OpenScript server port is 44444.
    Figure 10: The JConsole window showing OpenScript Output
  10. You can then interact with the application, and you should see messages in the console window.
    Figure 11. The Java Console showing recorded events with OpenScript and Oracle Forms
  11. Once you have finished recording, press the red stop button.
  12. When you return to the OpenScript workbench, click on Java View and you should see a screen similar to this:
    Openscript Workbench
    The important thing to notice is the forms.xxx api calls e.g. forms.textField(…).
  13. You can then play the script back and in the JConsole window you should see something similar to figure 12. (NOTE : If the script playback is slow go to OpenScript workbench View-> OpenScript Preferences and click on Playback. There will be a VU Pacing option. Change this to No Delay, and the script should run much faster).
    Figure 12. The JConsole window showing the replay of the test script

Summary

This should be a one-time activity to enable successful recording of Oracle Forms testing scripts. You should now be able to record test scripts using OpenScript and Oracle EBS/Forms Applications.

Last Updated ( Thursday, 31 December 2009 09:59 )  

Software Testing Information

About SCL

SCL delivers innovative software and services throughout the UK, Europe and Scandinavia.

We provide consulting services, training and software solutions for developing, testing, delivering and analysing business critical applications and digital marketing solutions. Our solutions are driven by our excellent technical skills and class leading products and we are passionate about exceeding our customers' expectations in terms of our skills, our solutions and the quality of our results.

Contact SCL

Telephone Tel: +44 1293 403636

Fax Fax: +44 1293 403641

email Email: info@scl.com