How do I get a record count on a database in a UFT GUI test?

  • Questions
  • 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: 361, Answers: 39)
Asked on April 29, 2016 6:58 pm
11 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: 16, Answers: 772)
Answered on April 29, 2016 6:59 pm
Thanks, that does work for us.
( at April 29, 2016 7:01 pm)