Forum Discussion
Thanks for your answer I had tried it but it is showing microsoft vbscript runtime error.Somehow code is not able to upload library file.
sAutoAppPath = "D:\BTAAF\FunctionLibrary\CommonFunction.vbs"
Call Sys.OleObject("WScript.Shell").Run(sAutoAppPath)
Function Sum()
call killProcess("Excel.exe")
End function
For me below code is working fine, I'm able to trigger the VBS file
Function triggerVBS
path = "D:\Users\Desktop\Test.vbs"
'Way1
WshShell.Run(path)
'Way2
Call Sys.OleObject("WScript.Shell").Run(path)
End Function - Ravik9 years agoSuper Contributor
I am also interested to know this.
Using this code
Function triggerVBS
path = "D:\Users\Desktop\Test.vbs"
'Way1
WshShell.Run(path)
'Way2
Call Sys.OleObject("WScript.Shell").Run(path)
End FunctionWe can load the .vbs file but we can not call the functions from inside of the functions.
lets say If I have creates multiple function like - add, divide, multiply etc or login, new order, logout
here we can't call these functions in TC. is there any way to call functions (add, divide, multiply etc or login, new order, logout) from .vbs file.
- tristaanogre9 years agoEsteemed Contributor
The VBS file can, probably, be added as an Existing script file directly in TestComplete. There's no need to load the library using the WScript.shell.
- Ravik9 years agoSuper Contributor
In our organization we are using multiple tool like - TestComplete, UFT and QTP. We have create some common functions like (Open Notepad file, open Excel file, click on object etc....) in VBScript. Instead of Copy and paste those common function in TestComplete. I wanted to load the .vbs file and use all functions which are available in it.
Like in UFT/QTP - at run time we can load and access the all function from VBScript (LoadFunctionLibrary(Path of VBS)