Forum Discussion

lcraig's avatar
Occasional Contributor
15 years ago

Large queries in Keyword testing

I'm using some large queries in keyword data-driven testing and need a better way to insert my query into the Call Object Method Operation Parameter tablename. I use apps like Enterprise Manager to help build the query, but TestComplete seems to require that the query be a single long line.

I tried to use find/replace to remove line breaks but it doesn't seem to recognize them.

Does anybody know a good way to get a query from Management Studio or Enterprise Manager into TC?



Transportation Insight

3 Replies

  • Hi Logan,

    If you mean SQL queries, please pay attention to the following facts:

    1. Working with databases is a complex task which can be implemented only in the script. So, I recommend that you create a corresponding script function via the TestComplete script editor and call the function from your test (you can use the Run Script Routine operation to call the function from a keyword-driven test). You might consider constructing the query dynamically via the concatenation of string variables. BTW, I recommend that you see the "Working With Databases" help topic for information on working with databases from TestComplete.

    2. You can use SQL Designer to construct SQL queries from TestComplete. Please see the "SQL Designer" help topic for more information.

  • lcraig's avatar
    Occasional Contributor
    Thank you for the expeditious reply.

    What are the limits of TC's ability to work with SQL queries in Keyword tests? I guess I should be more specific about the query in question. I'm only running select statements (so far), but this particular query does several joins and one sub-query. At what point should I determine that my query is too complex to be handled in a a keyword setting? I'm still pretty unafamiliar with traditional scripting.

    Thanks for the help.

  • Hi Logan,

    The keyword testing feature is supposed to be used for simple actions like clicks and keystrokes. Working with databases requires some programming, and the task can  be accomplished only via script (to use the data in a keyword driven test, you can only call the needed script routine or a code snippet from the test).