Parameterization is probably the most significant attribute of a well designed automation solution. accelQ provides a wide range of capabilities to effectively parameterize different test scenarios. Here is an example-driven discussion to understand best way to parameterize for a given requirement.
Example Action - Login to Salesforce
Assume you are writing an Action to login to Salesforce. Without any parameterization, our first cut logic might look something like this.
Requirement 1: Every test case requires a different username and password
In this situation, we need an ability that every Test Case is able to pass different values for username and password. This is a straight forward case to parameterize the Login action with User Name and Password and passing these values for every test case under the Scenario.
Requirement 2: All our test cases always login with same user ID and Password
In this instance, it is not necessary to parameterize the Login action, as all the test cases can always login with same username and password. Your testing does not need variation in credentials and so it is not necessary to burden passing username and password values at Test Case level.
In this situation, define Global Properties for User Name and Password and use these directly in the Action logic. Notice there are no parameters defined for this Action.
Even though the user credentials are fixed, it is a good practice to define as Global Properties to separate the data from the Action logic. Do not hard code the Action logic with literal values for user name and password. If ever in the future, these credentials change, it is easy to just update the Global Property without touching Action logic.
Requirement 3: I want to pass the credentials for User name and Password when the test is actually running
This may be the situation when in an organization, a different ID may have been assigned to each user. And a user would like to use his/her assigned credentials to login to Salesforce. Notice that all the test cases still need to use the same user name and password (no variability across test cases), but the actual values should be assigned at the time test is running.
In this situation, parameterize the Login action for User Name and Password (just like the Requirement - 1 above). And when you define the Scenario, override these parameters with Run Properties. When the test is running, you will be prompted to enter values for Run Properties, which in turn are used during test execution.
Comments
0 comments
Please sign in to leave a comment.