Professional Documents
Culture Documents
Test Steps
• Login to Qbank
• Navigate to Profile page by clicking on the user link in top right corner
Note In test automation logic, it is very common to use pattern based (regular expression) verifications on dynamic applications
Verifying Information on Web Page
Parameterizing Verifications
o Expected Values can also be parameters, not just the values that you input in the application!
• Naming of parameters to convey the purpose is very important: Expected Name, vs. Name
Building logic from Recorder
Waiting for
Application State
Execution reliability - Concept of
Synchronization
Waiting for application state
Example: Transfer Funds on QBank and Verify
Example Scenario: Verify Funds transfer on QBank
We will login to QBank, navigate to transfer funds, provide
necessary information and confirm the transfer.
Test Steps
• Login to QBank
• Navigate to Funds Transfer page by clicking the button Let’s Record this Scenario!
• Appreciate the fact that completing the
• Populate necessary information to transfer funds transfer transaction may take variable time
depending on the server load.
• Wait for the confirmation page to load
• Be sure to handle this variation!
• Verify that the transfer confirmation header is displayed.
• Type “wait” in Recorder context menu and
choose the command to wait for page text.
• Logout of QBank.
Waiting for application state
Key Notes on Synchronization
Synchronization is one of the most important ingredients for a reliable automation setup.
Two subjects on which you may synchronize Configure what to do on synch failure:
1. Waiting for an Element state • Show error in the report and continue
• Appear/Exists • Show error in the report and abort further test case
execution (when would you prefer this option? )
• Enabled/Disabled
• Just display as info and continue (when would you
• Text/Property/CSS Property prefer this? ).
Note You set the default synchronization times when you run the test, which is sufficient for most cases.
Write explicit synchronization logic where it is required beyond the default values from the Run modal.
Waiting for application state
Best Practices
Optimal Synchronization
• Hard-coded waits are not good, why?
• Is it always possible to avoid hard-coded waits?
• Is it a good idea to insert synchronization statement before every statement in the logic? Discuss.
• Discuss some examples where you would wait for the “state” of an element, such as an HTML or CSS Property?
• What all did you parameterize in the Populate Funds Transfer page?
• Do you really need to parameterize Memo field?
• What are the pros and cons?
o Is there a need to future-proof parameterization decisions?
o Some Best Practices here: https://support.accelq.com/hc/en-us/articles/360035522832-Optimizing-Outcome-from-
Action-Parameterization
Building logic from Recorder
Gathering Info from
Application
Read information and store in parameters
Gathering information from application
Example: Extend “Funds Transfer” Scenario
Extend the funds transfer scenario from the
previous examples Let’s Record this Scenario!
• In the Verify Transfer Confirmation Action, capture the • Open the existing Scenario, playback up to
the confirmation page step.
confirmation code displayed on the page and store it in
• Open the relevant Action.
an Action Output Parameter
• Hover over the confirmation field, and type
“get” in Recorder context menu. Choose “get
element text” command.
Note To open an existing test asset (Scenario, Action etc.), simply type partial name in the Global Search in the top-nav.
Avoid going to Navigator grids unless you need deeper analysis to find an asset.
Gathering information from application
Key Notes about Gathering Info
You may gather information from AUT for various reasons: To log the info, for logic building, or to
enable further verifications.
Two subjects on which you may gather Storing information: Action Output, or
information Local Parameter?
1. Gathering info from an Element 1. Local Parameter, when the utility of the
information is limited to the current Action’s
• Text/Property/CSS Property logic
• Functional properties such as get selected 2. Output Parameter in case the information is
item, get items count in dropdown etc.
of interest, for other steps in a business
process flow (Scenario)
2. Gather page text
Gathering information from application
About Action Output Parameters
• Why did we store the confirmation code as an Action Output instead of a Local Parameter?
• Think of some examples where an Action might need to output multiple parameters
• How important is the naming of an Action Output Parameter?
Note Action name, Input and Output Parameter names together form the Signature of an Action. What does it mean?
Glossary
• Synchronization - Page level
• Synchronization - Element level
• Verification - Page level
• Verification - Element level
• CSS Property
• HTML Property
• Local parameter
• Action output parameter
• Dynamic and static wait
• Patterns/Regex
• Abort test case
Building logic from
Natural Language
Logic Editor
Type logic directly in the editor, edit and
manage statements
Working with Logic Editor
Example: Extend ”Funds Transfer” Scenario for
Random data inputs
Scenario: Transfer funds on QBank and verify
Test Steps:
• Login to QBank
• Navigate to Funds Transfer page by clicking the button
• Populate necessary information to transfer funds
• Enter a random string of 10 characters in the memo and a random future date in the transfer date
• Wait for the confirmation page to load
• Verify that the transfer confirmation header is displayed.
• Logout of QBank.
Working with Logic Editor
Building Logic from the Editor
• Now, open the Action that populates the funds transfer information, and insert new statements in appropriate line
numbers
o Search for words that bring the command you need, and populate necessary arguments
o Capture output from some of these statements and utilize in subsequent ones.
Note Application State in the Recorder Browser is global. What does it mean?
Working with Logic Editor
Best Practices: Playback for incremental logic
• You noticed in this example, we are updating an existing Action with additional logic. We haven’t introduced any
new Action. Is this what steady-state automation maintenance about?
• How did the Playback feature help you streamline new logic development?
• When capturing information for random memo and date, you will use Local Parameters, instead of Action
Output. Why? What is the downside of making these Action Outputs.
• How do you insert a new statement before the first statement in an existing Action?
• Is it possible to design dates-related inputs as Action Input Parameters? What are the challenges? How do you
ensure the data in the Test Cases does not go stale?
Working with Logic Editor
About Command Search Dropdown
• Presents command results as you type your intent.
• Matching Actions and Commands are presented.
• Ability to filter the search domain by choosing command sets relevant for you.
• Access help for each listed command.
• Ability to open Command Explorer for comprehensive help on available Commands.
Working with Logic Editor
Let’s Try: Search for Commands
• For the following objectives, type the words in Logical Editor command search and find
appropriate commands:
o Press tab in an element, so that you can focus out of the field
o Remove the leading and trailing white spaces in a given text
o Find the table row which contains given text in a given column
o Hover on an element
For each command try and create sample statements with dummy inputs.
Working with Logic Editor
Advanced Example
Handling output validation in Automation
Advanced Automation: Example
Building Logic from Editor
• Login to Qbank
• Verify that the transfer confirmation header is displayed and output the transaction code.
• [new] Introduce a new Action to verify the transaction code in the Summary Page.
• Logout of QBank.
Advanced Automation: Think!
Building Logic from Editor
• Rather than linking information between multiple steps (Actions) by devising Outputs from one Action, and
Inputs to another Action, why not simply put the entire logic for the Transfer Confirmation in a single Action?
• What are some other options you can think of, when there is a large number of data elements that are captured
by one Action, and required as input in another Action?
Writing Element-related logic
Building Logic from Editor
• You can search for element related commands directly in Logic Editor
• When working with Smart-Locator Elements, select one of the Elements available in the Repository of the
Owner Context
o Elements may be saved into Repository, either from the Recorder or a View
Writing Element-related logic
Building Logic from Editor
• Insert Statement – before/after
• Command Arguments
o Inputting value for a command argument, various parameter types
o Enumerator inputs
o Conditional arguments
• Commenting, Annotation
• Multi-Select of statements
• Cut/Copy/Paste/Delete
• Keyboard Shortcuts
• Saving, Undo/Redo
Working with
Data Lists
Data Lists for enumerated input parameter
values
Working with Data Lists
Example: Search Transactions and Verify
In this example, we will open account transactions and try out various search fields.
• Login to Qbank
• Search for transactions by inputting values for type of transaction, status, date etc.
• Logout of QBank.
Working with Data Lists
• Focus on the Search Transactions Action and identify what the input parameters should be.
• Recognize that Transaction Type and Transaction Status can only accept limited set of valid values.
• Create a couple of different test cases covering the input parameters and execute the test.
• Generate Test Cases to satisfy the combination of Data List based input parameters.
Working With Data Lists
Best Practices
• What are the benefits of restricting the input parameter values to a Data List?
• What are the other inputs that you may want to convert to Data Lists in the Search Transactions Action?
o Is the Transaction Account a good candidate to work with a Data List? Why, or Why not?
o Not all dropdown fields may be appropriate to be input from a Data List.
Global Properties
Environment specific, Project level test
data constants
Working with Global Properties
What is a Global Property?
• Project level constants that hold data values required in your testing.
• Can provide “default” value which will be used if an environment specific value is not specified.
Parameter Overriding
• You noticed the value for URL was not part of the Test Case data. Why? Does every Action Parameter value need to be input onl y
from Test Cases?
• Instead, it was a literal value in the Scenario step itself. This is called Parameter Overriding. Why is it called that?
Further Examples
• Identify couple of examples where a Global Property may be appropriate in Action Logic.
o Is the Username and Password in a Login Action, a good candidate to be a Global Property? When would it be preferable?
o How is a Global Property different from using a hard-coded value in Action Logic?
Working with test data
Run Properties
Working with Run Properties
What is a Run Property?
Run Properties allow you to pass set of properties during test execution
Test Steps
• Login to Qbank
• Navigate to Funds Transfer page by clicking the button
• Populate necessary information to transfer funds – Modify logic to make it handle larger transfer amounts ( > $100),
where you would select a dropdown item for Purpose of Transfer. At the same time, we must verify that this dropdown
is NOT presented for lower amount.
• Wait for the confirmation page to load
• Verify that the transfer confirmation header is displayed.
• Logout of QBank.
Conditional Statements
Updating logic with conditional statement:
Workings
• Open the Scenario and execute up to the Populate Funds Transfer Action
• Open the Populate Funds Transfer Action and update logic as below:
• Business rule: If the transfer amount is great than $100, additional dropdown will appear to select the “Purpose of
transfer”, which is a mandatory field. Note: In the test cases, only enter up to a value of $150, as the system will throw
a daily-limit error if the amount exceeds $150.
o If the amount is greater than $100, select a random item from Purpose of Transfer dropdown.
o Else, verify that the Purpose of Transfer dropdown does not exist.
o Notice that you are asked to type for a “condition” the moment you selected a conditional statement.
Conditional Statements
Think! Other Examples
• Conditional statements can be used for:
o Verification and handling of expected state conditionally,
o To take different logic routes for accommodating business rules
• Think! Why is it important to verify the Purpose of Transfer dropdown does not exist for amounts up to
$100?
• Think! Where would you use else-if and else sub-constructs within a conditional statement. Discuss an
example.
Looping in Logic
Extend logic building using for repetition
statements
Looping in Action Logic
Example: Verify transaction codes on QBank
Test Steps
• Login to QBank
• Open the Account Activity page by clicking in the left nav.
• Verify that the transaction codes in all the transactions (rows) is as per the expected format. (12 character alpha numeric
string)
• Logout of QBank.
Looping in Action Logic
• Recognize that the transactions are presented in a table. (How?). Now think about what you want to validate, and
how many time to repeat that.
• Find the number of rows in the transaction table (type ‘get row count table’). (Why?)
• Loop on the number of rows in the table and verify each Transaction Code is of the format 12 character alpha
numeric. (type ‘verify table cell’)
Note In ACCELQ, index numbers in all the commands and use cases across the system start from 1.
(some programming languages start with 0)
Looping in Action Logic
• Think! Why do you need to store the iteration index in a local parameter in the loop logic?
o Do ---- while
o While loop
• Learn more about Tables and supported commands in the logic editor
Working with
Expressions
Expression for textual and numerical
calculations
Expressions in Action Logic
Test Steps
• Login to Qbank.
• Read the current total balance from the screen (how?), and store in Action Output (why?)
• Navigate to Funds Transfer page by clicking the button
• Populate necessary information to transfer funds
• Wait for the confirmation page to load
• Verify that the transfer confirmation header is displayed.
• Navigate back to the Account Summary page and verify that the new balance reflects the debited amount.
• Logout of QBank.
Expressions in Action Logic
Note Numeric comparisons are made easy in ACCELQ which automatically ignore currency and other characters like comma etc.
Expressions in Action Logic
Parameter Linking: Sharing data between
Steps of a Scenario
Best Practices: Data Driven Testing
• Exit out of the Design Studio and come back to the Business Process view of the Scenario.
• Open the test case and notice the input parameter values for the balance validation step:
• Would the Original Balance input value remain valid? What are the challenges?
• Is there an issue with passing the transfer amount to this step, by duplicating what was input to the transfer-populate
step? How do we avoid this duplication?
• Why is the same Transfer Amount being passed to two different steps? Can’t we avoid one of the parameters?
Note Every Action must be self-sufficient in terms of the inputs it needs. Do not count on what step will be invoked before a given
Action and similarly, what information is being passed to previous steps.
Expressions in Action Logic
• Think about a couple of situations where you may need to use Text Expressions in your application.
• Comparison of Numbers with the text on the screen may show failures because of currency symbols, comma
Main work-area
• Logic Editor on the left where you develop and manage Action logic.
• Side panel on the right which includes Recorder, Views, Elements and Parameters.
• Console on the bottom to display Playback log as well as local Action execution logs.
Note Views and Elements are owned by a Context, not Action. All the Actions belonging to a given Context share these assets centrally.
Entity Details Pages
Action
Logic Editor
• Natural Language Editor with comprehensive capabilities to write and manage Action logic.
• Logic is comprised of statements.
• Toolbar in the top providing access to editor functions.
• Context menu on a statement provides functionality relevant to the selected Action.
Console
• Console Tabs: Tabs to display the running of log of Playback and independently run jobs.
• Playback Toolbar: Toolbar for Playback configuration options and to display Playback status.
Note Views and Elements are owned by a Context, not Action. All the Actions belonging to a given Context share these assets centrally.
Entity Details Pages
Action
Entity Details Pages
Context
Recall that a Context owns one or more Actions. And the Context centrally manages the assets necessary to all its constituent
Actions. These include Views and Elements.
• Purge views: Removes Views which are redundant. System calculates the least number of Views required to support the smart -
locator elements in the Element Repository.
• Purge Elements: Removes elements from the repository that are not used in the logic of any of the Context’s Actions.
• Move Actions / View: Allows moving actions and views from this Context to another..
Main work-area
• Actions: List of Actions owned by this Context.
• Automatically captured when an element is saved with a smart-locator. Allows managing the element’s identification criteria over
the application changes.
• Explicitly captured to allow offline view to the application-under-test. You can make progress with test logic development
regardless of application’s availability.
View Canvas is how a View is rendered in a Context, or in Action. It offers functionality just like the Recorder, but is a
static screenshot.
Entity Details Pages
• Hover on Element: Allows you to identify the element on which an action can be initiated.
o Highlights in green if the Element being hovered is already in the Element Repository. Otherwise, it is highlighted in blue.
• Explore Mode: Double-click a highlighted element to explore the View. It allows reaching closely-overlapping elements more precisely.
o Vicinity mode navigates across elements based on physical proximity.
o DOM mode navigates across the elements based on their relative DOM positioning.
• Context Menu: Right-clicking on a highlighted element opens up a context menu:
o Save Element which saves the highlighted element in the repository, using Smart -Locator.
o Save-As allows ability to overwrite an existing smart-locator element with the new one. Or, to capture an “instance” of an Element for a given
resolution/device-type.
o Command selection, to record logic. (when opened in an Action)
o Smart-Forms to create bulk statements on a form or page. (when opened in an Action)
Entity Details Pages
• Run scenario: Brings up the Run modal with the current scenario pre-selected.
• Info: Offers functionalities such as rename, change description, and view/edit custom fields.
• Clone: Makes a copy of the Scenario, with an option to copy the test cases.
• Check-out/Check-in: When version control is enabled.
Entity Details Pages
• Test Steps: Scenario steps (workflow) is displayed along with information on any missing steps. You
can add/delete or re-arrange steps here.
• Test Cases: List of test cases is presented in a separate tab in the main work area. You can
add/delete or modify test cases from here. You can also generate or import test cases.
• Traceability: Information on the connected Requirements (from external systems), or manual test
cases (managed on ACCELQ Manual)
• Defects: Defects associated with the test runs resulting from this Scenario execution. Note that
defects are managed in external systems such as Jira, Azure, TFS, Rally etc.
Entity Details Pages
• Temporary Draft: Design Studio changes are managed as draft which are not persisted
on underlying Scenario until “finalized”.
• Enforces Modularity: With a view to long-term maintainability of Automation, ACCELQ
enforces that the draft cannot be saved unless all the Command statements are
converted into meaningful Actions.
• Playback: Playback allows troubleshooting the Scenario. Results are deleted once this
draft is saved.
• Elements and Views are only temporary: Elements and Views are created as you
record logic, but moved over to the respective Actions as part of modularity exercise.
• Parameters tab not applicable: Parameters tab is not present, as the draft represents a
Scenario, and cannot be parameterized in itself. Scenario makes use of Actions which are
parameterized.
Hands-on
15 mins
Successful recreation of work is pre-requisite
for the rest of the session
Assignment – Day 2