Forum Discussion
What code are you using for executing the SQL query? It someone depends upon that. If you're using the various ADO objects available in TestComplete, there is a way of setting the query timeout.
Basically, within the ADO schema, for everything there is a command object or you create one using ADO.CreateADOCommand. That command object has a property called "CommandTimeout". Set that to a numeric value, in seconds, to set your timeout value for your query.
I am using TestComplete to execute my query. I am in the process of setting up a data driven loop, so in Variables tab, I have set the type to DB Table, and the Default Value information is as follows: Specify the data source type (set to Database query), I have selected the server name, and selected the specific database, tested the connection, and it connects. Specify Query (I have put in the query and click the View Results Button.) It is when I click the View Results Button, that I receive the query time expired error. I haven't been able to figure out where to change the query time length.
- tristaanogre7 years agoEsteemed Contributor
With a more complicated query, is there a reason why you're not using DB Query as the option instead of DB table?
As it is, I'm not sure there is a way to change that timeout value in TestComplete. The default for ADO objects is 30 seconds so that is probably what is being used internally.
Your alternative is to build your data driven loop in script code and pass the result set to your keyword test for execution in some fashion. That way you can create your own query objects and such using ADO and over-ride the default command timeout.
As a side note: 37 seconds to execute a Select query against a database is an AWFUL long time. Either you have a whole LOT of data to retrieve or your query is not taking advantage of indexes and is doing table scans. I'd actually take a look at refining your query to see if you can speed it up.
- tcsdungeon7 years agoNew Contributor
The only Type options that I am seeing are: String, Integer, Double, Boolean, Object, Table, DB Table, and Password. DB Query isn't a choice. As for the query, it is optimized as much as it can be based on the data required for the test.
As for scripting, that is outside of my skill set, so I was hoping for a timeout option parameter.
- tristaanogre7 years agoEsteemed Contributor
When creating a data driven loop in a keyword test, you get the following dialog.
Database query is the option that I selected... and it makes better sense with needing to do a custom query.
As for scripting... a skill worth learning and I'd highly recommend doing so. As useful and functional as Keyword Tests are, they are lacking in the flexibility of being able to do all sorts of custom things that the world of Scripting provides. You will run into situations (and you just did :) ) where GUI wizards and such run their course and you need to do something more advanced. I'd definitely see about taking some online tutorials or courses in getting some training in scripting. I'd start https://www.w3schools.com/js/ for JavaScripting... well worth the time.
Related Content
- 6 years agorizzomeister
- 2 years agomattb