Forum Discussion

RKU_AVO's avatar
RKU_AVO
New Contributor
4 years ago

SAP environment

Hey there,

im trying to use testcomplete in the SAP environment but it is not working for me.

Some fields couldn’t be detected via OCR or normal testing.

I tried the image-based testing but that’s not perfect for me because the “pictures” could change and then I have to start the recording from beginning.

So I tried to use the SAP scripting.

But there I got two new Problems.

  1. I’m scripting in javascript and SAP scripting is in vbscript.

I have to use javascript because some expressions only work in javascript.

  1. How can I run the SAP scripting from Testcomplete?

I don’t get this simple script working…

 

************

If Not IsObject(application) Then

   Set SapGuiAuto = GetObject("SAPGUI")

   Set application = SapGuiAuto.GetScriptingEngine

End If

If Not IsObject(connection) Then

   Set connection = application.Children(0)

End If

If Not IsObject(session) Then

   Set session   = connection.Children(0)

End If

If IsObject(WScript) Then

   WScript.ConnectObject session,     "on"

   WScript.ConnectObject application, "on"

End If

session.findById("wnd[0]").maximize

session.findById("wnd[0]/usr/tabsTABSTRIP_600/tabpBUT2").select

session.findById("wnd[0]/usr/tabsTABSTRIP_600/tabpBUT3").select

session.findById("wnd[0]/usr/tabsTABSTRIP_600/tabpBUT4").select

session.findById("wnd[0]/usr/tabsTABSTRIP_600/tabpBUT1").select

session.findById("wnd[0]/usr/tabsTABSTRIP_600/tabpBUT1/ssubAREA_FOR_601:SAPMKAUF:0601/subAREA1:SAPMKAUF:0315/ctxtCOAS-KOSTV").setFocus

session.findById("wnd[0]/usr/tabsTABSTRIP_600/tabpBUT1/ssubAREA_FOR_601:SAPMKAUF:0601/subAREA1:SAPMKAUF:0315/ctxtCOAS-KOSTV").caretPosition = 4

*******

 

 

Thanks for your help!

  • Hi,

    Have you tried to enable '*' option for MSAA in your project? Does it provide better recognition of the problematic controls?

     

    I have to use javascript because some expressions only work in javascript.

    Can you provide an example? All scripting languages are more or less the same and provide similar functionality.

     

2 Replies

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi,

    Have you tried to enable '*' option for MSAA in your project? Does it provide better recognition of the problematic controls?

     

    I have to use javascript because some expressions only work in javascript.

    Can you provide an example? All scripting languages are more or less the same and provide similar functionality.

     

    • sonya_m's avatar
      sonya_m
      SmartBear Alumni (Retired)

      Thanks Alex!

       

      RKU_AVO have you tried what Alex is suggesting?