Hello,
I cannot make WScript.sleep to work..
When I start to run the script, here is what I get : Object required: 'WScript' -
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]/tbar[0]/okcd").text = "QF01"
session.findById("wnd[0]").sendVKey 0
WScript.Sleep 500
session.findById("wnd[0]/usr/ctxtQALS-PRUEFLOS").text = "30000020135"
session.findById("wnd[0]/usr/ctxtQALS-PRUEFLOS").caretPosition = 11
session.findById("wnd[0]").sendVKey 0
Wscript.Sleep 300000
session.findById("wnd[0]/usr/ssubSUB_ITEM_OVERVIEW:SAPLQFFE:4100/tblSAPLQFFEITEM_OVERVIEW_SER/ctxtQFAAI-FEGRP[1,2]").setFocus
If session.findById("wnd[0]/usr/ssubSUB_ITEM_OVERVIEW:SAPLQFFE:4100/tblSAPLQFFEITEM_OVERVIEW_SER/ctxtQFAAI-FEGRP[1,2]").caretPosition = 0 Then
session.findById("wnd[0]/usr/ssubSUB_ITEM_OVERVIEW:SAPLQFFE:4100/tblSAPLQFFEITEM_OVERVIEW_SER/ctxtQFAAI-FEGRP[1,3]").setFocus
Wscript.Sleep 300000
session.findById("wnd[0]/usr/ssubSUB_ITEM_OVERVIEW:SAPLQFFE:4100/tblSAPLQFFEITEM_OVERVIEW_SER/ctxtQFAAI-FEGRP[1,3]").text = "qfdc"
End If