04-03-2012, 12:23 AM
Hi,
I have created a qtp test for an application. Which is:
This is running fine in Qtp but I want to run the script without Qtp. So I pasted the script in notepad and saved it as .vbs file. But when I close Qtp to run the .vbs file it gives me error saying "Variable is undefined : "window"" error code 800A01F4 (Line 6, Char 1) Can anybody please explain me why am I getting this error?
I have created a qtp test for an application. Which is:
Code:
Option Explicit
Dim var_Exist, x , y
Dim rowcount, WshShell
Dim rownumber
var_Exist = Window("HyperTerminal_3").Exist
While var_Exist="True"
Call excel()
Wend
Function excel ()
datatable.Import"C:\HT_test\Commands.xls"
datatable.GetSheet(1)
rowcount = datatable.GetRowCount
For rownumber=1 to rowcount-1
datatable.SetCurrentRow(rownumber)
x= datatable.Value("Command")
If x= "e" Then
var_Exist="False"
else
y=datatable.Value("TimeInterval")
Window("HyperTerminal_3").WinObject("Term Class").Type x
Set WshShell = CreateObject("WScript.Shell")
WshShell.SendKeys "~"
wait (y)
Set WshShell = Nothing
End If
Next
This is running fine in Qtp but I want to run the script without Qtp. So I pasted the script in notepad and saved it as .vbs file. But when I close Qtp to run the .vbs file it gives me error saying "Variable is undefined : "window"" error code 800A01F4 (Line 6, Char 1) Can anybody please explain me why am I getting this error?