Hi,
I'd like to run testcases based on SQL-data, but the SQL queries are not static.
Here an example:
1. Start main testsuite which includes testcases for all possible product-parts
2. get the selected product from a dropdown and stored this value as "myproduct"
3. fire a MYSQL query to select all product-parts that assigned to the value of "myproduct"
4. start product-part testcase if the if its listed in the result of MYSQL query (by using the ranorex IF-condtions)
datadriven test with SQL and variables
Re: datadriven test with SQL and variables
Hi MiHa,
The SQL datasource integration in Ranorex Studio unfortunately does not support dynamic querying. However, you can write your own code in C# for this and use it as a code module that would populate the variable myproduct: How to directly execute SQL query in C#?
After you have the variable populated in your code method, then you need to do the "if-listed" check in code and if successful, then you further bind the myproduct variable to a global parameter. The global parameter can then be used in the conditions of the Ranorex test suite: How to Create Conditions in Ranorex without Coding
I hope that this information helps you.
Regards,
McTurtle
The SQL datasource integration in Ranorex Studio unfortunately does not support dynamic querying. However, you can write your own code in C# for this and use it as a code module that would populate the variable myproduct: How to directly execute SQL query in C#?
After you have the variable populated in your code method, then you need to do the "if-listed" check in code and if successful, then you further bind the myproduct variable to a global parameter. The global parameter can then be used in the conditions of the Ranorex test suite: How to Create Conditions in Ranorex without Coding
I hope that this information helps you.
Regards,
McTurtle