conehead wrote:
I have a count on an app screen that I'd like to edit. This should always be equal to a number of select rows in an Oracle table. I know how to Set Variable Value to what's on screen, but don't understand how I would retrieve:
select count(*) as my_count
from table
where status = 1
and location like '%BLAHBLAH%'
Do I somehow use a database checkpoint? Is it a matter of creating another variable that will dynamically change each Test Run?
I'm new to this and would like to know what the best approach would be.
Tks.
I wouldn't use a database checkpoint. Instead, I'd make use of the ADO objects available in TestComplete, write a JavaScript function to execute an SQL query and return the results, call that function within your keyword test and then set the variable value to "last operation result" to capture and store the result for comparison.
Documentation on ADO is here https://support.smartbear.com/testcomplete/docs/reference/program-objects/ado/index.html
I have an SQLUtilities script extension that encapsulates some of that for you. Part of it isn't working properly at the moment concerning using the parameters of the ADOCommand object... but you can by pass that by formatting the SQL Query string yourself before passing it to the utility. If you are interested, please PM me for assistance.