Setting the query of a JDBC datasource dynamically in TestCase setupScript
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2008
11:48 AM
01-31-2008
11:48 AM
Setting the query of a JDBC datasource dynamically in TestCase setupScript
Hi,
Is it possible to set the query for a JDBC DataSource dynamically through the SetUp script of a TestCase?
I have to fetch the query from a DB in the SetUp script and set it in the dataSource which has already been created
def dataSource = testRunner.getTestCase().getTestStepByName("DataSource")
Is it possible to set the query for a JDBC DataSource dynamically through the SetUp script of a TestCase?
I have to fetch the query from a DB in the SetUp script and set it in the dataSource which has already been created
def dataSource = testRunner.getTestCase().getTestStepByName("DataSource")
2 REPLIES 2
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2008
02:52 PM
01-31-2008
02:52 PM
Hi Tareque,
sure! Create a property at either the TestCase level or in a Properties-step, initialize that property in your setup-script (or any other way), and then expand it in your query. So if you create a property called "sqlQuery" at the TestCase level, then you can expand it with ${#TestCase#sqlQuery}
Hope this helps!
regards,
/Ole
eviware.com
sure! Create a property at either the TestCase level or in a Properties-step, initialize that property in your setup-script (or any other way), and then expand it in your query. So if you create a property called "sqlQuery" at the TestCase level, then you can expand it with ${#TestCase#sqlQuery}
Hope this helps!
regards,
/Ole
eviware.com
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2008
08:30 AM
02-01-2008
08:30 AM
Thanks Ole. You suggestions as always was spot on.
