Help testing DB result set

Ask general questions here.
combitz
Posts: 2
Joined: Thu May 10, 2012 9:19 am

Help testing DB result set

Post by combitz » Thu May 10, 2012 9:41 am

HI ,

I'm obviously missing something but I can't seem to find an example of how to validate a database results set from a query

I have set up a test case, created the database connection and the SQL returns the correct results visually but how do I validate the results?

I've tried creating variables in the repository, and I can select to bind to the results but I can't see the values in the repository so it shows an error and won't run, the videos and help show examples where you're running an application and entering the values, I can't do this as I'm trying to test permissions so there is no input from the user, I'm trying to test they have the correct permissions when added to the application, All the data already exists so at no point is any data entered, they are added to the DB via just a click in the GUI.

I just need to test/validate a single SQL query that may have multiple records.

Can you offer any help or advice

Thank you.

combitz
Posts: 2
Joined: Thu May 10, 2012 9:19 am

Re: Help testing DB result set

Post by combitz » Thu May 10, 2012 4:17 pm

Some more info to try and help highlight the problem.

After the user is added to the workspace I need to validate that they have the correct permissions, in this case just a "User". I've tried adding the variables to the repository (and the new recording) yet they are not showing when I try to select the item from the repository. I am unable to run the test as the "check user perms" recording complains it has no repository item but no valid variables or items show whne selecting it. There are only web page items which does not display the data I need to validate against.

I also tried to add the results I expect with the data bind tool in the Data manager but at no point do any of the variables show and I am unable to type into the empty module variable.

As the results from the database could and will eventually be multiple records should this be validated in code really? Or is there another way that it can be done via the ranorex interface, we are trying to remove the human error element so tests can't be accidently passed by more coding errors.

Any help appreciated.

Thanks

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Help testing DB result set

Post by Support Team » Fri May 11, 2012 3:33 pm

Hi,

one of your problems could be that you are binding your variable in a test case and try to access it in another testcase. Did you read this section of our user guide Data-Driven Testing?

If you only want to check the return values of the data query, you can try to make it directly in the UserCode by using one of the methods shown in the Ranorex Documentation.

I hope that helps!

Regards,
Bernhard
Ranorex Support Team
.
Image