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.

- Use the GuiSessionFactory.Launch method to open a new SAP GUI session.
- Use the GuiSessionFactory.Attach method to run your steps on an open SAP GUI session.

Back to top

See also:

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

https://admhelp.microfocus.com UFT Developer 8942
Tips to improve your search results... UFT Developer Help Center UFT Developer Help 15.0-15.0.2 All View Local Help Center View Online Help Center back Go back in browser history forward Go forward in browser history Remove search highlights next topic Go to next topic previous topic Go to previous topic Print the current topic Version: