Database Driving implementation

来源:互联网 发布:windows系统官方下载 编辑:程序博客网 时间:2024/05/21 05:38

Dim MyDriver

Sub Main
  Dim SQLStatement
  Dim ConnectionString
  ' Start Notepad
  TestedApps.Notepad.Run
  ' Limit to 10 records
  SQLStatement = "SELECT TOP 10 OrderID, CustomerID, EmployeeID FROM Orders"
  ConnectionString = "Provider=SQLOLEDB.1;Password=sa;" &_
    "Persist Security Info=True;User ID=sa;Initial Catalog=Northwind;Data Source=CHENNENGJI"
  ' Create Driver
  Set MyDriver = DDT.ADODriver(ConnectionString,SQLStatement)
  ' Call Method 10 times
  MyDriver.DriveMethod("Unit1.Test1") 
End Sub

Sub Test1
  Dim p1
  Dim w1
  Dim w2
  Dim KeyStr
  Set p1 = Sys.Process("Notepad")
  Set w1 = p1.Window("Notepad", "*")
  Set w2 = w1.Window("Edit")
  w2.VScroll.Pos = 0
  ' Create String with Customer Information
  KeyStr = MyDriver.Value("OrderID")& "," & _
    MyDriver.Value("CustomerID")& "," & _
    MyDriver.Value("EmployeeID")& "[Enter]"
  Call w2.Keys( KeyStr)
End Sub

 

原创粉丝点击