Tips and tricks - SAP GUI
The following tips and tricks are specific for testing SAP GUI applications.
Work with the SAP GUI SDK
Make sure you include:
C#: using HP.LFT.SDK.SAP.GUI;
Java: import com.hp.lft.sdk.sap.gui.*;
Declare your SAP GUI session in your test.
Even if you are working with objects from an application model, declare your SAP GUI session in the context of your test and then pass the GUISession as an argument when you instantiate your application model class:
C#:
IGuiSession session = GuiSessionFactory.Launch("ECC 6.0", "800", "qa01", "55c1b303f6a77cb79fcbb321af78eed77befc906"); mySAPGUIModel mySAPGUISiteModel = new mySAPGUISiteModel(session);
Java:
GuiSession session = GuiSessionFactory.launch("ECC 6.0", "800", "qa01", "55c1b303f6a77cb79fcbb321af78eed77befc906"); mySAPGUIModel mySAPGUISiteModel = new mySAPGUISiteModel(session);
Decide which SAP GUI session to use in your SAP GUI steps.
- To open a new SAP GUI session, use the GuiSessionFactory.Launch method
- To run your steps on an open SAP GUI session, use the GuiSessionFactory.GetAllOpenSessions method to retrieve the open session objects.
See also: