Sunday 24 April 2016

OPM Batch - Release and Unrelease



OPM Batch Release :

The  Release_Batch API checks  for the validity of the batch validity rule, and ingredient reservations to create transactions. It also checks for unexploded phantoms, except for those that are Automatic by Step with a step association. The Batch status is set to work in process.

API: GME_API_PUB.RELEASE_BATCH

Sample Code: 

create or replace PROCEDURE release_batch (p_batch_id IN NUMBER, p_run_seq_id IN NUMBER)
   IS
      lr_batch_header             gme_batch_header%ROWTYPE;
      lt_exception_material_tbl   gme_common_pvt.exceptions_tab;
      x_return_status             VARCHAR2 (10);
      x_batch_header              gme_batch_header%ROWTYPE;
      ld_st_date                  DATE;
      ld_com_date                 DATE;
      ln_msg_index_out            NUMBER;
      ln_batch_no                 NUMBER;
      ln_rule_id                  NUMBER;
      ln_org_id                   NUMBER;
      lc_org_code                 VARCHAR2 (5);
      lc_status                   VARCHAR2 (5);
      lc_message_list             VARCHAR2 (2000);
      ln_step_no                  NUMBER;
      x_message_count             NUMBER;
      x_message_list              VARCHAR2 (2000);
   BEGIN
      fnd_global.apps_initialize (user_id           => gn_user_id,
                                  resp_id           => gn_resp_id,
                                  resp_appl_id      => gn_prog_appl_id
                                 );

      BEGIN
         SELECT plan_start_date, plan_cmplt_date, batch_no,
                recipe_validity_rule_id, organization_id
           INTO ld_st_date, ld_com_date, ln_batch_no,
                ln_rule_id, ln_org_id
           FROM gme_batch_header
          WHERE batch_id = p_batch_id;
      EXCEPTION
         WHEN OTHERS
         THEN
            DBMS_OUTPUT.put_line (   'Error In Selecting Batch Mat Details'
                                  || SQLERRM
                                 );
      END;

      IF ln_org_id IS NOT NULL
      THEN
         SELECT organization_code
           INTO lc_org_code
           FROM org_organization_definitions
          WHERE organization_id = ln_org_id;
      END IF;

      lr_batch_header.batch_type := 0;
      lr_batch_header.batch_no := ln_batch_no;
      lr_batch_header.plan_start_date := ld_st_date;
      lr_batch_header.plan_cmplt_date := ld_com_date;
      lr_batch_header.update_inventory_ind := 'Y';
      lr_batch_header.recipe_validity_rule_id := ln_rule_id;
      lr_batch_header.actual_start_date := SYSDATE;
      gme_api_pub.release_batch
                        (p_api_version                 => 2.0,
                         p_validation_level            => 100,
                         p_init_msg_list               => fnd_api.g_false,
                         p_commit                      => fnd_api.g_false,
                         x_message_count               => x_message_count,
                         x_message_list                => x_message_list,
                         x_return_status               => x_return_status,
                         p_batch_header_rec            => lr_batch_header,
                         p_org_code                    => lc_org_code,
                         p_ignore_exception            => 'T',
                         p_validate_flexfields         => fnd_api.g_false,
                         x_batch_header_rec            => x_batch_header,
                         x_exception_material_tbl      => lt_exception_material_tbl
                        );
      COMMIT;

      IF x_return_status = fnd_api.g_ret_sts_success
      THEN
         DBMS_OUTPUT.put_line ('Batch Released');
       
      ELSE
         DBMS_OUTPUT.put_line ('Batch Release failed');

         IF x_message_count = 1
         THEN
            DBMS_OUTPUT.put_line ('Error:' || x_message_list);
         ELSE
            FOR i IN 1 .. x_message_count
            LOOP
               fnd_msg_pub.get (p_msg_index          => i,
                                p_data               => x_message_list,
                                p_msg_index_out      => ln_msg_index_out
                               );
               DBMS_OUTPUT.put_line ('Error: ' || x_message_list);
            END LOOP;
         END IF;

               END IF;
   EXCEPTION
      WHEN OTHERS
      THEN
         DBMS_OUTPUT.put_line ('Error ' || TO_CHAR (SQLCODE) || ': '
                               || SQLERRM
                              );
   END;

OPM Batch Unrelease :

Once a batch is released, the status will be reversed from Released to Pending. The completed transactions are reversed, actual values are reset to zero, and inventory is updated.

API: GME_API_PUB.UNRELEASE_BATCH

Sample Code:

create or replace PROCEDURE unrelease_batch (p_batch_id IN NUMBER, p_run_seq_id IN NUMBER)
   IS
      lr_batch_header             gme_batch_header%ROWTYPE;
      lt_exception_material_tbl   gme_common_pvt.exceptions_tab;
      x_return_status             VARCHAR2 (10);
      x_batch_header              gme_batch_header%ROWTYPE;
      ln_msg_index_out            NUMBER;
      ln_batch_no                 NUMBER;
      lc_org_code                 VARCHAR2 (5);
      lc_status                   VARCHAR2 (5);
      lc_message_list             VARCHAR2 (2000);
      x_message_count             NUMBER;
      x_message_list              VARCHAR2 (2000);
      i                           NUMBER;
   BEGIN
      fnd_global.apps_initialize (user_id           => gn_user_id,
                                  resp_id           => gn_resp_id,
                                  resp_appl_id      => gn_prog_appl_id
                                 );
      lr_batch_header.batch_id := p_batch_id;

      BEGIN
         SELECT organization_code
           INTO lc_org_code
           FROM org_organization_definitions
          WHERE organization_id = (SELECT organization_id
                                     FROM gme_batch_header
                                    WHERE batch_id = p_batch_id);
      EXCEPTION
         WHEN OTHERS
         THEN
            lc_org_code := NULL;
      END;

      gme_api_pub.unrelease_batch (p_api_version                => 2.0,
                                   p_validation_level           => 100,
                                   p_init_msg_list              => fnd_api.g_false,
                                   p_commit                     => fnd_api.g_false,
                                   p_save_batch                 => fnd_api.g_false,
                                   x_message_count              => x_message_count,
                                   x_message_list               => lc_message_list,
                                   x_return_status              => x_return_status,
                                   p_batch_header_rec           => lr_batch_header,
                                   p_org_code                   => lc_org_code,
                                   p_create_resv_pend_lots      => 1, -- Recreate reservations- NO
                                   p_continue_lpn_txn           => 'N',
                                   x_batch_header_rec           => x_batch_header
                                  );
      COMMIT;

      IF x_return_status = fnd_api.g_ret_sts_success
      THEN
         DBMS_OUTPUT.put_line ('Batch Unreleased' || x_message_list);
      ELSE
         IF x_message_count = 1
         THEN
            DBMS_OUTPUT.put_line ('Error' || lc_message_list);
         ELSE
            FOR i IN 1 .. x_message_count
            LOOP
               fnd_msg_pub.get (p_msg_index          => i,
                                p_data               => x_message_list,
                                p_msg_index_out      => ln_msg_index_out
                               );
            END LOOP;
         
            COMMIT;
         END IF;
      END IF;
   END;

Friday 22 April 2016

                                       Oracle Flow Builder

The Oracle Flow Builder application is a keyword-driven component based testing 
framework for testing Oracle E-Business Suite applications. Oracle Flow Builder 
starter kit includes 2100+ components and 200 flows for testing Oracle E-Business
Suite.
The Oracle Flow Builder application consists of the followings:
1. Home
2. Component
3. Component Set
4. Flows
5. Notifications
6. History
7. Settings
8. Reports
9. Administration


Step 1:Home
It shows the logged in users Access Rights with options for requesting
changes and lists recent notifications and components. Roles and permissions
information is also provided.


Step 2:Component
Component shows the currently available component tree and provides options
for adding new components and defining the keywords and parameters that
define the component code.


Keywords:

Step 3:Component Set
Component Set shows the currently available component sets tree and provides
options for adding new component sets that link multiple individual components
that are used together frequently in test flows.


Step 4:Flows
Flow shows the currently available flows tree and provides options for adding
new flows that define the sequence of components, component sets, and test data
to use to generate test automation scripts.


Step 5:Creation of Requisition Flow
a.Create a flow and give a valid flow name and tag  namefor a flow.
b.Click Create Structure.



The Flow will be created shown as below.
c.Expand the Approved Components.


d.Drag and Drop the components to the flow.


e.Give the Test Data  for the flow components and save the data.



Once,the flow is created.R.C Flow name to view OFT code for the flow.


The OFT code contains 2 script.
1.Master Drive -It will call the child script(Requisition).
2.Requisition script(Flow Script)



Generate the OFT scripts for testing the flow.




Generate and Download Test Plan Document available in the flow builder.





Step 6:Notifications
Notification shows the informational and To Do messages generated during use
of the Oracle Flow Builder application.

Step 7: History
History provides options for searching the history of components, component
sets, flows, and users.
Click View history to view all history results of the component.

Step 8: Settings
Setting provides options for specifying the email notification preferences.



Step 9:Reports
Reports provide options for searching and viewing reports for components,
component sets, and flows.


Step 10:Administration

Administration provides options for setting up the release and product structure
within the application, setting up the Email server, managing function libraries,
managing approvals, and managing product family access.


                                                 Oracle Test Manager

Oracle Test Manager is an easy to use tool that allows you to organize and manage
your overall testing process. It provides a single unified platform for sharing
information among team members.
Oracle Test Manager has the following features and advantages for integrated
requirements management and defect tracking for both manual and automated tests:
1.Requirements Management
2.Test Planning and Management
3.Defect Tracking
4.Integration with Oracle Application Testing Suite
5.Reporting
6.Administration 
7.Custom Fields 
8.Database Repository


Step 1: Test Plan

1. Create a Test Plan for a script Testing.
2. The number of test plans displayed is determined by the number enter in the
    maximum Tree Nodes field in options. 
3. Edit this Test Plan,Print,e-Mail ,Navigation options are available in the Test Plan
4. Click on an associated requirement to view its details.
5. Click on an attachment to open it in the appropriate application.
6. Click on a link to view the URL in a separate browser window.
7. Select Add/Edit to add or edit attachments, links, or associated items.


Step 2: Requirement
  
1.Create Requirements for the Script Testing
2.To Create a Requirement.
3.Search requirements by clicking the Find button.
4.Group requirements by clicking Group.
5.Filter requirements by clicking Filter.
6.Toggle between the tree view and grid view by clicking the Tree View and Grid
  View buttons.
7.The color of the icon in front of the requirement indicates its priority. The default
colors are as follows and can be changed by changing the order of the Requirement
Priorities in the Administrator.
a)  Red, high priority
b)  Yellow, medium priority
c)  Green, low priority


Step 3: Test 

1.It allows to create a New Test or run/edit an existing script.
2.Schedule when to run tests by clicking the Schedule button.

3.The icon in front of the test indicates the type of test as follows:
a) Manual test - blue with a pencil.
b) Test folder - blue with a spiral.
c) Oracle OpenScript - blue with a pencil.
d) Test group - blue with a plus sign.
e) 3rd Party test - blue with two stars

Manual Test:



4.The color of the icon in front of the test indicates the last result from running the test,
as follows:
a) Green, passed
b) Red, failed
c) Yellow, warning
d) Blue, not run
e) Silver, currently running


Automated Test:

5.Create a new test and run the test in Oracle OpenScript

Type:Oracle OpenScript


Select script from the mounted repository.


6.Click Run this Test and Testing will be automated .
7.Allow to Add/Edit the Test Steps.




8.Click Edit this test to open the Edit Test dialog box.
9.Click Run this test to start the Run Manual Test wizard or run an Oracle
   OpenScript test.
10.Click Delete Results to display the Delete Results dialog box for deleting results
    from particular test runs.
11.Click the date in the Run History section to display result details for a particular
    run.

Step 4:Test Execution

Test Execution contains Test Set and Test Folder Type.


Step 5:Issues

Issues will be captured in the Issue tab.
In Issues tab,Add/Edit options are available.


Step 6:Reports

The Reports tab has both standard and custom reports.
Oracle Test Manager comes with a standard set of reports that can be viewed as either
a graphic or as data. In addition, Can create custom reports to display only the
data 
1. Clone an existing report to create a copy of it that you can then edit by clicking
   Clone.
2. Filter the fields in the report to display only the data in which you are interested.
3. Export reports to jpg, and xls formats.


Step 7:Dashboard

Dashboard report is available for requirements, tests, and issues. 
It allows to customize which reports are displayed for each and then save the view. 
In addition,Able to select the number of columns to use for the display.

Test Cases Dashboard:


Issues Dashboard:


                                             Oracle OpenScript 

OpenScript is the next generation environment for developing Oracle Application
Testing Suite scripts for Web application testing.

Features:
1)Scripting Workbench
2) Test Modules
3)Graphical/Tree View Scripting Interface
4)Programming/Code View Scripting Interface
5)Properties View & Results View
6)Data Parameterization
    a)Databank
    b)Database
    c)Data Table
    d)Shared Data Service
7)Correlation
8)OpenScript Preferences
9)Multi-User Execution

Settings:
The Following Settings required before recording a scenario,
1.Browser:IE or Firefox
  For IE:
  Enable Add-ons in IE
    Tools--->Manage Add -ons -->Toolbars and Extensions
    Oracle.OATS.OpenScript.IEToolBar.OpenScriptToolBar
    OpenScriptBHO

For Firefox:
Enable Add-ons in Firefox.



2. In OpenScript,Go to OpenScript Preferences
Select Browser
Select Playback and Record Browser(IE or Firefox)


Step1:
Create a new script using Oracle EBS/FORMS




The file will be created in repository.

Step 2:
The Script contains:
1.Initialize
2.Run
3.Finalize


Step 3:RECORD
Starts the selected OpenScript script recorder 
Record the Scenario for testing.

Browser Launch


Stop recording ,once the scenario is completed.
Step 4 : Navigation and java code will be generated in the Openscript.
Step 5:The following steps required to add CSV file in the Openscript
To configure Databanks to use with a script:
1Select the Assets .
2Select Databanks.
3Click Add.
4Select CSV file or Database. Once a databank is defined as CSV or Database
(SQL), the databank type cannot be changed to the other type.
5For CSV files:
a. Select the Repository from the My Repositories tree.
b. Select the Databank file from the repository.
c. Set the Type to Databanks (*.csv, *.txt).
6Click OK.


Step 6:Map the csv file column with the navigation fields.




Step 7: PLAYBACK
Plays back the currently open OpenScript.
Playback for multiple scripts is supported using any of the following:
– OpenScript Playback button
– Command-Line Interface
– Oracle Load Testing
– Oracle Test Manager

Select Playback Button

Playback get started for the recorded scenario.




Step 8:Script Result Summary Details: