How do I get a record count on a database in a UFT GUI test?
Question ID: 106846
1
0

I need to get a record count for a list of items in a database.

Marked as spam
Posted by (Questions: 387, Answers: 66)
Asked on April 29, 2016 6:58 pm
63 views
Answers (1)
1
Private answer

One way to do it would be to have a stored procedure that runs the query, then execute the stored procedure from UFT, like in the below code.

The variable 'ra' is the record count and you can use that value to validate that there was rows deleted..

Below is the script we used:

Dim con
Dim ra

Set con=CreateObject(''ADODB.Connection'')

con.ConnectionString= ''<>''
con.Open

con.Execute ''exec <>'',ra
msgbox ra

con.Close
Set con=nothing

Marked as spam
Posted by (Questions: 17, Answers: 807)
Answered on April 29, 2016 6:59 pm
0
Thanks, that does work for us.
( at April 29, 2016 7:01 pm)
EyeOnTesting

Welcome back to "EyeOnTesting" brought to you by Orasi Software, Inc.

X
Scroll to Top