Recording and virtualizing RFCs

You can record and virtualize SAP application resources. If you are testing a Java application that uses the SAP Java Connector (JCo) to make remote function calls (RFCs) to an SAP application server, use HCL OneTest API to record and virtualize those calls.

Before you begin

Software requirements:
  • A Java 6.0 or later application
  • SAP Java Connector 3.x
  • HCL OneTest API
  • HCL® Quality Server
  • Java virtualization agent that is provided with HCL® Quality Server.
Note: HCL OneTest API supports virtualizing the RFC and BAPI services only and not the whole SAP application stack. Therefore, whenever service virtualization is used for RFC/BAPI transactions, a permanent connection is required between the client application and the SAP system.
Complete the following tasks:
  1. In Library Manager, ensure that the SAP Java Connector library is configured correctly. Completing this task enables HCL OneTest API to communicate with a physical SAP application server and synchronize schemas.
  2. In HCL OneTest API, create the required physical SAP application server transport and logical SAP application server in your project and import schemas from the physical SAP application server. Completing this task enables HCL OneTest API to apply schemas to all recorded messages.
    Note: When creating the logical SAP application server, you can use the Function filter field in the RFCs tab in the SAP System window to filter the RFCs that you want to record.
  3. Ensure that your HCL OneTest API project is connected to a valid instance of HCL® Quality Server. Completing this task enables HCL OneTest API to issue commands to the Java virtualization agent.
    Note: To ensure that the connection is working correctly, click Project > Project Settings on the menu bar, click the Server Settings tab on the Project Settings window, and verify that a green checkmark icon is displayed next to the URL field on the HCL Quality Server area of the tab. If there is no URL displayed or if there is a red cross icon next to the URL field, contact your HCL OneTest API project administrator.
  4. Ensure that a domain is selected on the Server Settings tab on the Project Settings window. If there are no domains, a domain must be created by a HCL® Quality Server administrator. Recording occurs within a domain and the Java virtualization agent can be registered with all domains or a single domain in the HCL® Quality Server instance that you are using. Therefore, selecting a domain in HCL OneTest API enables the application to record or virtualize RFCs.
    Note: If the domain-level security is enabled, you can connect only to domains to which you have been granted access.
  5. Install and configure the Java virtualization agent and install the agent into the Java application. Completing this task enables HCL OneTest API to record or virtualize RFCs.

About this task

You can create tests and stubs from any recorded events captured in the Recording Studio perspective and from any operations captured in the Logical View of the Architecture School perspective.

Procedure

  1. In HCL OneTest API, open the Recording Studio perspective.
  2. Create a recording monitor for the logical SAP application server.
  3. Start a recording session by clicking Start Recording (Start Recording) on the toolbar of the Events View window.
  4. In HCL® Quality Server, open the Infrastructure Dashboard, expand the agent card and from the Activities tab verify that recording has started.
  5. Wait for recorded events.
    Note: Depending on the Java application that you are testing, you might have to use the application to generate recorded events.
  6. Stop the recording session by clicking Pause recording (Pause recording) on the toolbar of the Events View window.

Results

In Recording Studio, you can use the Recorded Events wizard to save the recorded events as a test, stub, or other project resource.