Define the test
At First it is important to define that why we run this test so simply this test is run in order to make an entry in a database and then authenticate if it is been added or not. Here the AUT will be the Ranorex Demo Application and the steps that are necessary include:
- First stssart the Ranorex Demo Application.
- Click on the tab of Test database.
- After than write the first name and last names in the required fields.
- From the drop department make a selection of the department.
- Write the age in the required field.
- Choose an option for gender from the gender box.
- Click on the Add Entry.
- Confirm that entries numbers has altered from 0 to 1.
- Than exit the Ranorex Demo Application.
Review the recording modules
Our sample solution already comprises of the requisite recording modules.
These modules are arranged in two folders i.e. application folder and other one is data base function model. In the folder of application functions those modules are present that are needed in order to manage the application whereas the folder of database functions consist of the modules associated to adding up an entry to the database.
Assemble the test
So now we have everything and we just have to start building our test. One test suite in our project is present i.e. RxDatabase.rxtst and It must be open already. If it is not opened than by just simply double-clicking on the file in the project view it will get open.
Add a setup region
For adding a global setup region:
- By Right-clicking on the test suite and clicking Add setup.
- From the module browser, by dragging the module StartAUT to the setup region.
Add the database test
For this we ll be using the existing test case but renaming it is a good option.
- Click on test case and press the F2 button.
- Change its name to SimpleDatabaseTest and press Enter button.
In order to add the modules now these steps will be followed:
- Drag the modules to the test case from mobile browser.
- They can be added individually or by selecting numerous modules simultaneously by using Ctrl + Click.
Create a module group
In order to insert the modules to a module group:
- Select the four modules by making use of Ctrl+ Click or Shift + Click.
- By Right-clicking the modules; and after that by clicking Group selected modules.
- The recently made module group opens in the module group view.
- After that renamethe module group to InsertPerson and shut
- The test case now comprises of the module group InsertPerson as well as the module group also become visible in the module browser for use again.
Add a smart folder
As tests grow larger and more complex, it can become difficult to manage the test suite. Smart folders are a useful structuring item to overcome this issue. Instead of filling a test case with 50 modules that all logically belong to the same test, add smart folders to the test case and organize the modules in them. Smart folders also make it easy to exclude particular parts of a test case from being run during test execution. This is exactly what we’re going to use a smart folder for in our example. We might not always want the validation to be carried out, so it will get its own smart folder. To add ValidateEntries to a smart folder:
- Right-click the test case SimpleDatabaseTest and click Add > New smart folder.
- Drag ValidateEntries to the new smart folder.
- Rename the smart folder to Validation.
Add a teardown region
Our test is nearly complete now and we only have to add the last step that is to add the teardown region:
- Right-click the test suite and after that click Add teardown.
- Than drag the module ExitAUT from the module browser to the teardown region.
Run the test
Well done, you have just created a test in the test suite. Now you can apply the fundamental standards of this lesson to any of the test you want to create.
The advanced options of running tests will be discussed in the next chapter. For now just press the RUN and do the database test executing!