Hi,
is it possible to use different data sources (SqlDataConnector) for debug and release build?
Especially for DataConnectors using a view or a select-statement?
Thanks in advance,
BcTest
Rx: Different data sources in debug and release build?
Re: Rx: Different data sources in debug and release build?
Hi BCTest,
Regarding changing the SQL data during runtime, I recommend checking out this post:
dynamically-assigning-data-sources-t586 ... ntent24637
Regarding changing the data based on the build configuration, there is a debug constant enabled by default for the 'Debug' and off for 'Release'. This means we can use the below code to dynamically set the sqlQuery for our SQL data connector based on the build configuration.
I hope this helps!
Regarding changing the SQL data during runtime, I recommend checking out this post:
dynamically-assigning-data-sources-t586 ... ntent24637
Regarding changing the data based on the build configuration, there is a debug constant enabled by default for the 'Debug' and off for 'Release'. This means we can use the below code to dynamically set the sqlQuery for our SQL data connector based on the build configuration.
Code: Select all
#if DEBUG
string sqlQuery = "abc";
#else
string sqlQuery = "123";
#endif
Last edited by N612 on Tue Mar 19, 2019 4:00 pm, edited 1 time in total.
Re: Rx: Different data sources in debug and release build?
I also do something similar, but I examine the AUT path to try and determine if it's a debug or release build. I run a code module which in turn sets a global parameter with its decision. I then use that global parameter as a variable in a Condition on Smart Folders or Test Cases to determine whether certain tests run or not. I could pump in different data sources to the Smart Folders or Test Cases in this way - so far all I've used are the really simple datasources built into Ranorex.
Re: Rx: Different data sources in debug and release build?
Hi,
Thanks for the answers.
I know the possibility of changing a data-connector and use it frequently. But I don't know how to change the data-source for a select-statement. Think of a data-source like "SELECT * FROM table" or "SELECT * FROM view", how to redirect this data-sources to a different database for DEBUG and RELEASE?
The second answer is tricky and seems to be a suitable solution, I'll look for it.
Regards,
BcTest
Thanks for the answers.
I know the possibility of changing a data-connector and use it frequently. But I don't know how to change the data-source for a select-statement. Think of a data-source like "SELECT * FROM table" or "SELECT * FROM view", how to redirect this data-sources to a different database for DEBUG and RELEASE?
The second answer is tricky and seems to be a suitable solution, I'll look for it.
Regards,
BcTest
Re: Rx: Different data sources in debug and release build?
Hi BcTest,
I think Stubs idea is great. It would enable you to use totally different databases depending on the build as you can connect different data sources to different test containers. It's also not very complicated.
Regards,
McTurtle
I think Stubs idea is great. It would enable you to use totally different databases depending on the build as you can connect different data sources to different test containers. It's also not very complicated.
Regards,
McTurtle