Search code examples
hp-uft

What´s the point of SAPGuiSession.Sync


The documentation for SAPGUISession.Sync says:

Instructs UFT to wait until the SAP GUI for Windows session is available.

Is this 1:1 comparable to Web add-on´s Page.Sync? If so, when should I call it? Do I have to call Sync...

  • after each input sent to the SAP GUI?
  • after each input sent to the SAP GUI if a server roundtrip takes place after this input is received? (How can I identify that one takes place?)
  • after each context-changing input sent to the SAP GUI?
  • only once after launching the SAP session?

I haven´t had a chance to use the Windows-SAP Support in UFT yet, that´s why I find the documentation to be rather sparse.

Thanks...


Solution

  • SAP´s Sync works just as Web´s Sync, but one important difference is:

    While Page.Sync is often no guarantee that the app really is idle when Page.Sync Returns, for SAP applications, SAPSession.Sync´s returning does indeed guarantee this.

    So whenever the SAP Client is doing Server roundtrips, SAPSession.Sync is a very save way of obtaining synchronization (i.e. awaiting SAP client´s idle state).