Quantcast
Channel: SCN : Discussion List - Scripting Languages
Viewing all articles
Browse latest Browse all 325

VBS Script: Wait, Pause, Sleep

$
0
0

Dear EXperts,

 

Newbie here.

I was able to record something (picking progress in TC LT45) and thus generate a VBS file.

Now, running this script is doing what it should do, except for the timing: It runs way too fast and therefore I am searching for adding some command/code to pause.

I found examples like Application.Wait("0:00:1000") but SAP does not like that.

See 'my' code below.

 

Any answer will be appreciated.

Thanks, Nick

 

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]").resizeWorkingPane 263,47,false

session.findById("wnd[0]").sendVKey 8

Application.Wait("0:00:1000")

session.findById("wnd[0]").sendVKey 3

session.findById("wnd[0]").sendVKey 8

Application.Wait("0:00:5000")

session.findById("wnd[0]").sendVKey 3

session.findById("wnd[0]").sendVKey 8

Application.Wait("0:00:1000")

session.findById("wnd[0]").sendVKey 3

session.findById("wnd[0]").sendVKey 8

session.findById("wnd[0]").sendVKey 3

session.findById("wnd[0]").sendVKey 8

session.findById("wnd[0]").sendVKey 3

 

Edited by: N. Lagace on Mar 8, 2012 1:37 PM


Viewing all articles
Browse latest Browse all 325

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>