Error Handling can be as simple as
Dim oe As TOnError
Set oe = OnError("ScriptErrorHandling.ErrorFunction")
Those two lines. We then have a Shared Moduale called ScriptErrorHandling with a Function of ErrorFunction
Inside that we code what ever we want. Right now I use it to send me an e-mail when I get an error on the Automation Box (I check which box the script is run on) if its the Automation I grabe a picture of the screen, then send an e-mail to me with a picture and the error code. But you can do what ever you want.
For the fun of it we just put in code
Set sapi = CreateObject("sapi.spvoice")
That uses the voice function of Windows XP. So I can actually have the machine say something when it errors (its more for the fun of it).
[ QUOTE ]
Verifying Data in Database
[/ QUOTE ]
I don't know if there is an easy way to explain this. You need to look at stuff more for VBA then really Test Parnter.
We set up an ODBC connection in windows. We then set up Test Partner to connect to that ODBC connection
Dim GlobalCnn As ADODB.Connection
Set GlobalCnn = CreateObject("ADODB.Connection")
This is not Test Partner code but more uses the Lanugage of VBA to get it to work.
We have this set up for each of our Database Connections.
Then in each script we call this
Dim dc As New Get_Database_Connection
Dim rs As ADODB.Recordset
Dim MySql As String
Set Cnn = dc.getConnection()
The Include is the Shared Module that has the get Connection (which is code from above).
rs is the Record set (again this isn't Test Partner code)
MySql is just a String.
The Set line is setting up the connection So pretty much at the start of the strip I have the connection to the database.
Then in my Test Partner code I just write the SQL
MySql = "Select column from table where column = something"
Set rs = Cnn.Execute(MySql)
'You have to check to make sure you get a value
If rs.EOF = False 'EOF = End of File
varable = rs.field("Column name").value