0

I am running a driver script for QTP through VBScript, that i have not had issues with until recently. I am running this on a VM and until recently i have never gotten this Error: Path Not Found, Code: 800A004c, and it appears on Line: 58, Char 15, which is my variable strBaseFunctionPath is being used.

I am using this exact same script on a seperate VM with no issues. I am somewhat new to VBScripting. I read that this has to do with not finding the file, but everything is there, as it creates the file and pulls from a seperate script. Again this was working last week. Any Ideas?

    strEnvironment = "QA" 'QA,QA2,FEDP,STAGE,PROD,FO,TEMP
    strBuildNumber = "Build_12_44"
strProject = "HAL"
strSuite = "Full" 'Custom,Full,Smoke
bolTimeStampDate = True
bolAppendMode = False

'<-><-><-><-><-><-><-><-><-><-><-><-><-><-> TEST SUITE TESTS <-><-><-><-><-><-><-><-><-><-><-><-><-><-><->
strTestString = "C:\Quicktest\HAL\Scripts\Helper\Clear Cache and Cookies" &_
"C:\Quicktest\HAL\Scripts\HAL Travel Agent HQ\LILO Travel Agent HQ" &_
"C:\Quicktest\HAL\Scripts\HAL Academy\LILO HAL Academy" &_
"C:\Quicktest\HAL\Scripts\HAL\FE-BE Testing\Online Check-in" &_
"C:\Quicktest\HAL\Scripts\HAL\FE-BE Testing\Book A Shore Excursion" &_
"C:\Quicktest\HAL\Scripts\HAL\FE-BE Testing\Book A Cruise Tour" &_
"C:\Quicktest\HAL\Scripts\HAL\FE-BE Testing\Book A Cruise" &_
"C:\Quicktest\HAL\Scripts\HAL\Locality\Find Cruises\Find Cruises - All Currencies - EN" &_
"C:\Quicktest\HAL\Scripts\HAL\Locality\Find Tours\Find Tours - All Currencies - EN" &_
"C:\Quicktest\HAL\Scripts\HAL\Locality\Contact Us\Validate Contact Us - EN" &_
"C:\Quicktest\HAL\Scripts\HAL\Locality\Special Offers\Validate Special Offers - All Currencies - EN" &_
"C:\Quicktest\HAL\Scripts\HAL\Locality\X-Forward-For Modified\Validate Currency - EN" &_
"C:\Quicktest\HAL\Scripts\HAL\My Account\Change Email - EN" &_
"C:\Quicktest\HAL\Scripts\HAL\My Account\Change Password - EN" &_
"C:\Quicktest\HAL\Scripts\HAL\My Account\Update Account Info - EN" &_
"C:\Quicktest\HAL\Scripts\HAL\My Account\Password Email Reset - EN" &_
"C:\Quicktest\HAL\Scripts\HAL\Registration\Register New User - EN" &_
"C:\Quicktest\HAL\Scripts\HAL\Site Navigation\Site Navigation - EN" &_
"C:\Quicktest\HAL\Scripts\HAL\Locality\Find Cruises\Find Cruises - All Currencies - NL" &_
"C:\Quicktest\HAL\Scripts\HAL\Locality\Find Tours\Find Tours - All Currencies - NL" &_
"C:\Quicktest\HAL\Scripts\HAL\Locality\Contact Us\Validate Contact Us - NL" &_
"C:\Quicktest\HAL\Scripts\HAL\Locality\Special Offers\Validate Special Offers - All Currencies - NL" &_
"C:\Quicktest\HAL\Scripts\HAL\Locality\X-Forward-For Modified\Validate Currency - NL" &_
"C:\Quicktest\HAL\Scripts\HAL\My Account\Change Email - NL" &_
"C:\Quicktest\HAL\Scripts\HAL\My Account\Change Password - NL" &_
"C:\Quicktest\HAL\Scripts\HAL\My Account\Update Account Info - NL" &_
"C:\Quicktest\HAL\Scripts\HAL\My Account\Password Email Reset - NL" &_
"C:\Quicktest\HAL\Scripts\HAL\Registration\Register New User - NL" &_
"C:\Quicktest\HAL\Scripts\HAL\Site Navigation\Site Navigation - NL"

testArray = Split (strTestString,"C:\Quicktest\")
'<-><-><-><-><-><-><-><-><-><-><-><-><-><-> END TEST SUITE TESTS <-><-><-><-><-><-><-><-><-><-><-><-><-><-><->

'<-><-><-><-><-><-><-><-><-><-><-><-><-><-> TEST SUITE CONTROLLER <-><-><-><-><-><-><-><-><-><-><-><-><->
intBeginScript = 1
intEndScript = 29
'<-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><->

'<-><-><-><-><-><-><-><-><-><-><-><-><-><-> TEST RESOURCE PATHS <-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><->
strBasePath = "C:\Quicktest\"
strBaseProjectPath = strBasePath & strProject
strBaseFunctionPath =  strBaseProjectPath & "\QTP_Runner\Functions\Runner.vbs"
'<-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-<-><-><-><-><-><-><-><-><-><-><-><-><-><->

'<-><-><-><-><-><-><-><-><-><-><-><-><-><-> OPEN FUNCTIONS FILE <-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><->
Dim fsObj : Set fsObj = CreateObject("Scripting.FileSystemObject")
Dim vbsFile : Set vbsFile = fsObj.OpenTextFile(strBaseFunctionPath, 1, False)
Dim myOtherScript : myOtherScript = vbsFile.ReadAll
vbsFile.Close
Set vbsFile = Nothing
Set fsObj = Nothing
ExecuteGlobal myOtherScript
RunTestSuite
CJ Powell
  • 35
  • 1
  • 11

1 Answers1

0

In the code you posted line #58 is Set vbsFile = Nothing, I'm guessing the line that's giving you the error is line #55

Dim vbsFile : Set vbsFile = fsObj.OpenTextFile(strBaseFunctionPath, 1, False)

I would suggest printing out strBaseFunctionPath and making sure the file exists.

BTW: Next time it would be more helpful to say which line is producing the error rather than dumping the whole file and giving a file number.

Motti
  • 110,860
  • 49
  • 189
  • 262
  • Thank you i will print that out to see...actually if you read what i wrote above the code it is line 3 of my question where i state the line Error: Path Not Found, Code: 800A004c, and it appears on Line: 58, Char 15 . Also i am running an exact copy of that code and it is working.... – CJ Powell Oct 24 '12 at 19:40
  • @CJPowell you wrote that it is on line 58 but there's no way to tell which line is line #58 other than counting. When asking for help it's best to make life easier for those who want to answer in order to raise their motivation to do so. – Motti Oct 24 '12 at 20:42