Forum Discussion
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 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 Function
We 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)
- tristaanogre9 years agoEsteemed Contributor
That's what "Add -> Existing Item" is for. There's no need to load it at runtime. If you want to add a VBS file to a project, you can "Add -> Existing Item" to add the vbs file. You may need to change the select box to look for files of the proper extension but this should allow you to include any VBS file in TestComplete.