Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Importing Data from a Database
#9
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi,

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?
Reply


Messages In This Thread
Importing Data from a Database - by rajeshwar - 05-26-2010, 12:44 PM
RE: Importing Data from a Database - by Saket - 05-26-2010, 01:03 PM
RE: Importing Data from a Database - by rajeshwar - 05-26-2010, 02:48 PM
RE: Importing Data from a Database - by qtp-qa - 04-03-2012, 12:23 AM
RE: Importing Data from a Database - by lotos - 09-14-2010, 08:45 PM
RE: Importing Data from a Database - by lotos - 11-23-2010, 08:40 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Importing excel not working Adam82 6 13,599 11-05-2012, 05:22 PM
Last Post: Adam82
  it is possible import from excel to table with expected data of checkpoint database i sarcastic 0 2,256 08-05-2011, 04:42 PM
Last Post: sarcastic
Smile importing objects and properties to excel sheet sandy.jakhar 2 3,686 03-16-2011, 03:26 PM
Last Post: sandy.jakhar
  mapping database user to database kamalteja 4 4,687 11-03-2010, 11:58 AM
Last Post: kamalteja
  Data importing from excel using script vaigundamoorthy 3 3,717 05-19-2009, 04:53 PM
Last Post: lit_73

Forum Jump:


Users browsing this thread: 2 Guest(s)