Share this page

# Tips and tricks - SAP GUI

The following tips and tricks are specific for testing SAP GUI applications.

In this topic:

## 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.*;`

Back to top

## 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);

Back to top

## 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.

Back to top

See also:

- Tips and tricks - General
- Tips & tricks - Web testing
- Tips & tricks - OCR methods (Windows only)

https://admhelp.microfocus.com Functional Testing for Developers 8942
Tips to improve your search results... OpenText™ Functional Testing for Developers Help Center OpenText™ Functional Testing for Developers Help 25.2 All View Local Help Center View Online Help Center Version: