February 20th, 2015 by inflectra
In Rapise there are several options as far as controlling interaction with a database from outside the user interface. Most of what you do in Rapise is interaction just like a user would, clicking buttons and interacting with drop-downs, text boxes, and on-screen data, but occasionally there is a need to make a manipulation behind the scenes.
One of these situations is in the case of validation. When needing to validate that your on-screen actions are having the desired effect. Let's say you have just entered a new order into your POS system, or client tracking system. The primary function is to have that data available later. In order for that to happen, it must be logged into the database and stored. Sure, you could do a lookup from the screen, and probably should, but this does not ensure that the data has left memory and been actually put into storage for the long term.
The scenario, in this case, involved querying the database pre-insertion to insure record does not exist in its final form, performing the task to enter or modify the record, validating that the record has been modified in the database, then validating that it is accessible from the user interface. This way you have ensured that the test case is not corrupted by pre-existing data and you validate that the process works through validating data storage and retrieval.
Another scenario you may wish to consider is one where the data for the test is contained in a database. In this case, the database may be queried for the most recent or relevant data depending on other elements. Real-time queries can provide for some very powerful tests on systems that are changing moment by moment.
There are certainly other types of queries and manipulations you may wish to do as a part of your database testing, experiment, and feel free to play. Please be sure that you are not testing on a production database as data destruction is not looked at as a kindly mistake. If you must test on production please make a backup of the database pre-test, and restore post-test. One final item of note, check your database permissions. If you attempt to query or manipulate without acceptable permissions the test will fail through no fault of the tool, but a "fault" of security.
To access the database commands in Rapise, select the object tree element on the left-hand side. One of the elements you will see in the collapsed form is Global. Expand global by clicking on the plus sign and you will see one of the contained items is Database. By expanding the Database section you can drag and drop the various commands into your test.
The commands are as follows…