Hi,
I was trying to create a delay in my Active Script test:
FUNCTION PerformTest()
While not <condition>
Wscript.sleep()
wend
END FUNCTION
I get the following error:
Error number :424
Source :Microsoft VBScript runtime error
Description :Object required: 'Wscript'
I'm not familiar with any other way to create a delay in VBscript
Any advice?
How to use Wscript.sleep() in Active Script test
Unfortunately its impossible to create Wscript object within Active Script.
There are 2 possible workarounds:
1) create separate VBS script with single command.
E.g. create Sleep5000.vbs file with single line "WScript.Sleep 5000"
Then you may add simple code into your main script
Sub Sleep5000
Dim WshShell
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run "wscript.exe C:\path_to_another_script\Sleep5000.vbs", , true
End Sub
This allows you to call Sleep5000 procedure instead of Wscript.sleep
2) Use Shell Script instead of Active Script
You just need to modify your script a little
http://www.ks-soft.net/hostmon.eng/mfra ... m#chkShell
Regards
Alex
There are 2 possible workarounds:
1) create separate VBS script with single command.
E.g. create Sleep5000.vbs file with single line "WScript.Sleep 5000"
Then you may add simple code into your main script
Sub Sleep5000
Dim WshShell
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run "wscript.exe C:\path_to_another_script\Sleep5000.vbs", , true
End Sub
This allows you to call Sleep5000 procedure instead of Wscript.sleep
2) Use Shell Script instead of Active Script
You just need to modify your script a little
http://www.ks-soft.net/hostmon.eng/mfra ... m#chkShell
Regards
Alex