Micro Focus QTP (UFT) Forums

Full Version: QTP doesn't undestand "Option Explicit"
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi all,

Pls help me. I write a sript in VBS, and QTP can't understand it. Each time I run the script, QTP show a run time error: "The test can't be run due to an unrecoverable error: File not found Line (1) Option Explicit".
Please put your properly formatted code here.
Here is the code:
Code:
Option Explicit

' Load StartUp class
ExecuteFile "C:\Frame hai\Utilities\StartUp.vbs"

Dim strTestSuite, keywordTest

' Path to the Test suite
strTestSuite = "C:\Frame hai\Test Suite.xls"

' Create instance of StartUp class
Set keywordTest = New StartUp

' Execute tests in the specified workbook
keywordTest.funRunTest(strTestSuite)

' Release resource
Set keywordTest = Nothing
...by any chance have you given option explicit statement in startup.vbs also and have not defined the variable there...or check if the file path is correct....

this statement can also be reason for error...
Code:
Set keywordTest = New StartUp