Thursday, October 4, 2012

ExecuteFile function


   Hello! ExecuteFile is a VB script function which is used to execute any VBS (VB Script) file. It is also used to dynamically mapping a VBS file to a test.

Syntax : ExecuteFile "FileName with Path"

Example : ExecuteFile "C:\Test.VBS"

   You may ask that why do we have to use ExecuteFile function instead of mapping an VBS file to the Test. It depends on the situation and based on the use of the VBS file.

   Say for Instance, we have library (VBS) file which contains all common functions for a Test. It is important to note that this VBS file may required any part of the test as it contains all the common functions. So it is always better to map the VBS file to the test. All the library files that mapped to the test will be executed at the beginning of the exection.

   There may be a different case in which it is required to exectue a VBS file only on a specific scenario or a step. In this case, we can use ExecuteFile method to execute the script at the required step.

No comments:

Post a Comment