Parameter are used in most modern applications to communicate data between the user and the application. AppPerfect offers extensive parameter-management. Parameter selection and hence testing with various parameter values is completely automated. Parameter values are passed via the window attributes or event arguments/attributes. In the AppPerfect application, parameters are stored as name-value pairs, making it intuitive for application developers and testers. Then, depending on the number of iterations for your project, multiple parameter values can be tested, with options to select parameters sequentially or randomly. The following types of parameters are supported in AppPerfect App Test:
Runtime parameters are those parameters whose value can be picked either from a DB or from a CSV file just before the replaying of test or task starts. This way AppPerfect App Test ensures that it is running the test with most recent values present in either DB or CSV file. You can change the values in DB and CSV file just before running the test in order to test this application with different parameter values.
Fixed parameters are those parameters whose values can be entered manually or picked from DB or picked from CSV file while defining the test. AppPerfect App Test will maintain this hard-coded list of values and will use these values during replaying. In this case each time test is run same set of values will be used.
Consider a application with a login screen which takes a user name and a password. You need to test this application to ensure valid users (of various categories) are accepted and invalid users (incorrect user name/password) are rejected. To test this screen, what you essentially want to do is connect a series of user names and passwords to the login screen. This process of defining multiple values for elements is called Parameterization.
While it is possible to manually go to the login screen and enter each of the user name/password values and then have the test repeated, often, the number of combinations of input values is too large to perform manually. Consider a case of an e-commerce application with thousands of items in the database. In such cases, parameterization plays a vital role in making your tests flexible and powerful.
AppPerfect App Test records attributes for the Window element on which event was recorded. It also records the event arguments which should be used to replay events, like "keyboardInput" argument containing the value with which "type" events should be executed. You can parameterise Atributes as well as event arguments. Multiple parameter values can be defined for a recorded element. If the test is run for multiple iterations you will also need to specify the mechanism that the AppPerfect App Test must use to pick from the list of possible values. Random and Sequential are two supported ordering in which values can be selected.
AppPerfect App Test recognizes the wide spread use of parameters and provides extensive support for it. Parameters can be created and then applied to individual Windows/Events that have been recorded. You can also define whether the applied parameters must be applied sequentially or randomly on subsequent invocation of task.
These are the following ways in which you can access the Parameter Setting Wizard.
On clicking 'Parameterize' button a parameter settings dialog will be shown, which will allow you to configure parameter value as constant or configurable test parameter. You can create new test parameter and associate it with Window Attribute or Event argument/Attribute here.
You can see a list of configured test parameters using "Parameters" Node in the Editor tree. Select any test parameter to see its details at the bottom. You can edit the test parameter using the UI provided at the bottom. The test parameter configuration has following fields:
Data Source: You can choose the data source from one of the following :
Parameter Selection: You can choose parameters Sequentially or Randomly. The Random selection option is very useful when you want to test a large number of values in limited time. Every replay of the test will pick random values, thereby giving you a good picture of the application's stability and performance.
Add Value: If you want to add parameters manually (Fixed Values), then enter the values in this field and click the Add button. The values added will appear in the non-editable text area Parameter Values.
Use Fixed Values when there are only a few values you want to test the parameter with. You can configure parameter to have fixed pool of values from where the value should be picked during execution. But in most cases, you will find that Importing the values from a Database or a CSV file will make your application's testing for parameters very efficient.
Database ID: Select the database id from the dropdown provided. It will have ids of all the Database connections configured with AppPerfect App Test. In case this dropdown is empty, you need to configure a Database with AppPerfect App Test. Click on configure button and it will take you to Tools -> Options -> Browsers, JDKs & DBs. You can configure Database connection settings there. Once you configure the database you will find the database id for same in this dropdown which you can select,
Query: Enter the query that will be used to fetch the rows. It is recommened that you Validate this query before replaying the test, as it will eliminate the possibility of failure due to non-connectivity with the database.
Fetch Values: Select from - Now or Runtime. If you select 'Now' the connection will be established right away with your database and values will be fetched.
If you select 'Runtime' the connection with your database will be established while the test is being replayed when you reach the point where values have to be provided. This will be slower than the earlier option, but more realistic for testing.
Fetch All Rows: Select this checkbox if you want to fetch all rows from your database. Please ensure that you are aware of how many rows are contained in the database so that the time it will take to fetch the values can be built into replaying the test.
Number of rows to fetch: Enter the number of rows to fetch if you have not selected the previous checkbox.
Validate Query: Click this button to validate the SQL query.
Please note for CSV files: The values in your CSV files can be separated with a comma(,), semicolon(;), colon(:) or tab, but each value must appear on a new line.
CSV File: Browse to the location of the CSV file.
First row contains column header: Select this checkbox if the first row in your CSV file contains column header, i.e. the actual values start from second row.
Column Index: If your CSV file has multiple columns, you need to specify the column index from which to fetch the values. By default the column index value is 0.
Value Delimiter: Select the character which is used in your CSV file to separate values.
String Delimiter: If your file contains strings as values for parameters, specify the character that separates the strings. For instance, the strings in your file may appear with double quotes. If you don't want to use the double quotes in the values taken from the file, then specify double quotes here (").
e.g.: "Java", "J2ee", "JMX", "XML"
In the above, the value delimiter is comma (,) and the string delimiter is double quotes (").
Fetch Values: Select from - Now or Runtime. If you select 'Now' the connection will be established right away with the CSV file and values will be fetched.
If you select 'Runtime' the connection with your CSV file will be established while the test is being replayed when you reach the point where values have to be provided. This will be slower than the earlier option, but more realistic for testing.
Fetch All Rows: Select this checkbox if you want to fetch all rows from the CSV file. Please ensure that you are aware of how many rows are contained in the CSV file so that the time it will take to fetch the values can be built into replaying the test.
Number of rows to fetch: Enter the number of rows to fetch if you have not selected the previous checkbox.
In case you need to generate unique parameter values automatically with fixed prefix/suffix or if you need to generate date from Today's date or random date in various format then you can select Calculated values as datasource. For example in case you calculate as "number" with fixed prefix say "example" and increment by 1, then values generated would be example1, example2, example3 etc. If you select Calculate as "Date", you will be able to configure the date format (either select from pre-defined date formats or provide your custom date format as it is an editable combo box). You can choose between Today's date or Random Date. In this case application will generate the value as date string in specified format.