Forum Discussion

francisco1's avatar
francisco1
New Contributor
2 years ago

i need a unique connection in all keywordtest

I am currently using SQL SERVER as the database.

In each of my tests I need to make several queries and save them in variables to later compare them and evaluate if I send an error.

 

However, since I have to be testing in different databases, changing the name of the database in each of the variables is inefficient, that's why I created an ODBC connection but when using it in the variables, it gives me an error when executing the query For this reason it does not allow me to use the ODBC connection, can you help me?

 

How can I configure a single connection and that all my queries use that connection, in such a way that when I modify the database to execute the tests, I only change it in one place.

1 Reply

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    From what you have described, it will be easier to do this in script as opposed to keyword test. You can use keyword test to call the script.

     

    See Working With Databases. Create a function, where you pass in your connection string, followed by your sql query and return your value.