- SAP Testing Tutorial
- SAP Testing - Home
- SAP Testing - Overview
- SAP Testing - Types
- SAP Testing - Manual & Automation
- SAP Testing - SDLC
- Testing Type in SAP
- SAP Testing - Process
- SAP Testing - Navigation
- SAP Testing - Screen Flow
- SAP Testing - Modules
- SAP Testing - Interfaces
- SAP Testing - Cases
- SAP Testing - TAO
- SAP Testing - TAO Folder Structure
- Configure Quality Testing Center
- SAP Testing - TAO Results Analysis
- TAO Build & Execute Test Script
- SAP Testing - TAO Consolidate
- SAP Testing - TAO UI Scanner
- SAP Testing - Automation Tools
- SAP Testing - Solution Manager
- SAP Testing - HP Business Process
- SAP Testing - QTP
- SAP Testing - Case Study
- SAP Testing Useful Resources
- SAP Testing - Questions & Answers
- SAP Testing - Quick Guide
- SAP Testing - Useful Resources
- SAP Testing - Discussion
SAP Testing - Navigation
SAP testing navigation ensures that you cover each module of your SAP system and perform at least one test for each functionality. It also reduces the manual testing effort and covers most of the testing paths in a SAP system.
OPA tests can be performed to check SAP Testing Navigation. OPA is known as Open Source Programming language and it is mostly used for developing web applications. For compilation of OPA program, you can use Node.js on the server and JavaScript on the client side.
Creating a Test using OPA
OPA allows you to use three objects in Qunit. These functions should be defined in a test so that OPA knows what actions to be taken.
Given − to pass arrangements.
When − actions to be taken.
Then − assertion.
Example
The following example shows how to use all the 3 objects in Qunit −
jQuery.sap.require("sap.ui.test.Opa"); jQuery.sap.require("sap.ui.test.opaQunit"); opaTest("press a Button", function (Given, When, Then) { // Arrangements Given.iStartMyApp(); //Actions When.iPressOnTheButton(); // Assertions Then.theButtonShouldHaveADifferentText(); }
The next step is to define the three functions.
Defining the Functions
var arrangements = new sap.ui.test.Opa ({ iStartMyApp : function (){ return this.iStartMyAppInAFrame("../index.html"); } });
In the above function, we have assumed that the app runs in a page called index.html. Our OPA test is located in the test/opa.html folder.
Defining Arrangements
var actions = new sap.ui.test.Opa ({ iPressOnTheButton : function (){ return this.waitFor ({ viewName : "Main", id : "pressMeButton", success : function (oButton) { oButton.$().trigger("tap"); }, errorMessage : "No Button found" }); } })
Defining Assertions
var assertions = new sap.ui.test.Opa ({ theButtonShouldHaveADifferentText : function () { return this.waitFor ({ viewName : "Main", id : "pressMeButton", matchers : new sap.ui.test.matchers.PropertyStrictEquals ({ name : "text", value : "got pressed" }), success : function (oButton) { Opa.assert.ok(true, "The button's text changed to: " + oButton.getText()); }, errorMessage : "No change in Button's text" )} } })
Running the OPA test
sap.ui.test.Opa.extendConfig ({ arrangements : arrangements, actions : actions, assertions : assertions, viewNamespace : "view." });
To Continue Learning Please Login
Login with Google