Automate Web Training Day 1
Automate Web Training Day 1
Automation across
lifecycle process
areas
Top Navigation
Tabbed view for Entity details Global Search Create New Entity
ACCELQ application is built on a multi-tab Allows searching and accessing all the major Create a new Action, Scenario, Context or Test
architecture. An entity-details view opens in a new entities in the system. Commonly used to open Suite from here, no matter where you are in the
tab, making it easier to multi-task. various entities during day-to-day development. application..
Left Navigation
Tabbed view for Entity details
ACCELQ application is built on a multi-tab
architecture. An entity-details view opens in a new
tab, making it easier to multi-task.
Application Universe
Application Universe represents an abstraction
of your test application’s interactions. It depicts
various entities and their relationships. Navigator Grids
Navigator is a section in ACCELQ application where all the
core entities can be listed in a grid format. Allows extensive
filtering capabilities..
Resources
Resources section shows listing of support
entities that complement the core entities in
ACCELQ.
Results
Test results are summarized in the Result grid with
extensive filter capabilities.
• Installed on your local desktop, or in your execution lab • A software component that takes up and fulfils test
environment. execution requests initiated from ACCELQ.
• A portal that manages the Agent installation, maintenance • Enables the cloud-based ACCELQ server to run tests
and operations. remotely in the application's local network.
• Allows configuring Agent Properties as applicable for • Range of configuration options to support various use
your execution requirements cases.
• Can manage one or more Agents, centrally on one local • Hosts Playback Service which allows local validation
hardware. and troubleshooting of scripts during test development.
Note Type acc:// in your Chrome browser to open the Agent Command Center.
QBank
Retail & Corporate Banking Portal
URL https://qbank.accelq.com
Username john.todd
Password qbTrnPass1&
Scenario to Automate
We will verify Login to the QBank Application using the credentials, and Logout.
Test steps
• Make sure the Local Agent is active and the Playback service is up.
• Type the URL in the Recorder browser. Make sure the Recorder button is enabled.
• Hover over the elements that you need to automate, and right-click.
• Choose necessary operation (Command) from the context menu.
• Complete the operation by providing inputs necessary for the Command.
• Repeat this for all the interactions you want to achieve in the test.
Note Design Studio is a powerful orchestration engine to fluidly record/playback automation Scenarios in a codeless paradigm.
What is Design-First?
Prioritizing thoughtful design as a foundation for building reliable and maintainable test automation.
Note Remember, “CHANGE” is a “CONSTANT” in test automation; and be prepared for it from the get-go (why?).
Hello World!
Finalizing the Scenario: In 2 simple steps!
1 Modularize Login Scenario
NOTE • When you launch the URL in the Recorder, System already inserts an Action (step) in the Scenario, at the top (Init Action).
• Clearly distinguish between a “Command” statement which is an operation in the Scenario logic vs. the Action statement,
which is a functionally meaning Step in the business process!
Hello World!
Test Case
A data-driven instance of a Scenario business process is a Test Case.
• You may create one or more Test Cases for a Scenario, when the Scenario Steps include Parameters
• One test case is created by default, with the values used in the Design Studio.
• Manage Test Cases from the Business Process view of the Scenario entity.
Let’s add another Test Case to our Login Scenario using following credentials for a bank Admin:
qbankadmin/qbTrnPass1&
Hello World!
Playback the entire Scenario and notice the interactions in the Recorder browser.
Console Log shows the progress of test execution.
Note: Distinguish the execution that was happening during Recording, which is called “Auto-Playback”.
Hello World!
For an Independent test run, detailed test report can be accessed from the
Results grid or from the Results tab in the Scenario page.
Let’s create a new Scenario that includes additional validation in Home Page, after login.
Test steps:
Let’s create a new Scenario with this additional verification (do not update the existing Scenario).
Reuse and Extend
• Type the URL in the browser, and right-click on the Login field.
• Powerful capability that automatically
• Select Relevant Action (Login to QBank). predicts suggestions for the next steps in the
• Right-click on “Welcome back!” text and type “verify page”. Select flow, as you build a Scenario.
appropriate command. • In a continuous learning loop and adapts to
• Right-click on Logout button and select Relevant Action pill. user activity while you add/edit Scenarios.
• Playback the new Scenario and check out the console log!
Note: Acknowledge the text verification in the home page warrants to be an independent Action. Why?
Introduction to
Key Entities
Key Automation Entities in ACCELQ –
Action, Context and Scenario
Key Entities in ACCELQ
Scenario, Action & Context
Scenario Action Context
• Scenario represents an end-to-end test flow (a use • Action encapsulates a specific • Context represents a state of the
case) in the AUT, which can be “run” as a test. functionality available in a Context or Page application-under-test (AUT), such as
of the application-under-test (AUT). a page in your web application.
• A Scenario is created by assembling series of
Actions belonging to various Contexts (or Pages). • It represents a functionally meaningful • An Action originates from a Context
user action possible in a Context (or Page).
• Scenario is operated in two views: Business Process
View, Design Studio View
• “Check enrolment”
Action name should indicate a “verb” describing its purpose, and not about “how” the purpose is achieved
• “Details Page”
Test Case name should identify the data variation being exercised
• “Test case 1”
Key Entities in ACCELQ
Best Practice: What constitutes an Action?
An Action should encapsulate a functionality that has well-defined business semantic on an application– like a Step in a
business process.
• Each Action should represent a clear and specific task on a single page of the application. For instance, filling out a login
form or verifying transaction details on a page.
• Avoid mixing different tasks within a single Action, even if they are on the same page. For example, don't combine logging in
and forgot password logic in one Action.
• The size of an Action (logic in an Action) doesn't matter; it could be as short as one statement or involve many statements to
complete a task.
• Effective parameterization can avoid lot of Action duplication.
Action Granularity is the single most important consideration to achieve maintainable automation
Discuss how well-defined boundaries for Actions help mitigate maintenance efforts with ongoing application changes.
Elements and
Element Identification
Working with Element ID using Locator-
Free and Smart-Locator approaches
Elements & Element ID
What is an Element?
An Element refers to a UI field or control on the page that you are trying to interact with or verify in Automation.
Element Identification is the criteria you setup to uniquely identify the element on the screen when the test is running.
In the examples so far, we have used Locator-Free.. as in… there were no Locators at all!
Elements & Element ID
Example: Verify QBank Notifications
We will login to ACCELQ and navigate to the Notifications page by clicking the bell icon in the top.
Verify the heading in the notifications page, and then close the page by clicking the button in the top.
Test steps:
Once done, Playback the entire Scenario and finalize with appropriate
modularity.
Elements & Element ID
What is Locator-free Approach?
• AI powered algorithm to utilize readable or textual information on screen to identify the Element.
• Element ID is embedded inline in the application logic statement, without the need for explicitly “saving” the Element.
• Test logic is resilient to the application DOM structure changes. (What is DOM?)
• Ambiguity (multi-matches) can be resolved using the concept of Anchor Text, Index or both.
• Dynamic text can be handled using various operators such as starts-with, ends-with, contains, regular expression etc.
(‘Close’ button in notifications page)
• Some Elements may not present a reliable Locator-Free option [For example, the Notifications icon in the example]
Note Locator-Free need not always rely only on visible text on the screen! A whole lot of parameters define “readable text”.
Note In a typical Application-under-test (AUT), 80% to 90% of Elements can be handled Locator-Free!!
Elements & Element ID
What is a Smart-Locator?
• ACCELQ constructs unique ID for an Element, using an optimal combination of DOM attributes of Element. Discuss what is
“Optimal”?
• Element is given an explicit name, and its identification criteria is stored in the Element Repository of the respective Context.
• Views are automatically captured to help with Element edits.
• Advanced patterns such as Container Elements are best handled with this approach.
• System may invoke Self-Healing in case of application changes, or incorrect Element ID criteria.
Note Elements stored as Smart-Locator have a “name”, and Statements in logic refer to this name!
Note When an Element is saved as a Smart-Locator, it is important to quickly review the system selected attributes by
opening the Element in the Elements side panel.
Elements & Element ID
3 support entities for Smart-Locators
1. Owner Context: Context in which a Smart Locator Element is stored.
All Smart-Locator Elements used by the Actions that originate from a Context are stored in that Context (page).
Note You can explicitly store an Element in the repository, from the Recorder context menu by clicking the “Element …” button in the top.
Elements & Element ID
Default Approach to Element ID
Locator-Free is the default approach for Element ID from ACCELQ Recorder, or Logic Editor.
• You can manage this default behavior from Resources > Project Settings. Three options available:
o Default is Locator-free
o Default is Smart-Locator
• If a Locator-Free hint is not available for a given Element, it is stored as Smart-Locator automatically.
• While recording a statement in the Recorder, click on [L/O] button in the context menu against a command to
explicitly select the type of Element ID to use.
Glossary
• Element
• Context
• Element Repository
• View
• Owner Context
• DOM
• Smart-Locator
• Locator-Free
• Anchor Text
• Label/Self-Text
• Label/Anchor-operator value operator
• Index
• Logical Name
All about
Playback!
Instantly validate your test logic,
troubleshoot and finalize
All about Playback
What is Playback
Playback is a local execution capability within the Logic Editor against the inbuilt Recorder browser.
• Playback offers instant feedback on execution result, allowing for efficient fine-tuning and troubleshooting.
• Browser state and overall execution state persists across multiple Playback requests, allowing you to switch across
Actions/Scenarios and continue Playback requests.
• Auto-Playback is a specific setting that executes statements in real-time as you type or record in the Logic Editor
Playback is not currently supported for Mobile, Desktop or TE related automation statements.
All about Playback
How to Playback
How to Playback
• Click “Playback” toolbar menu, or Right-click on a statement, in the logic editor for context menu option
Note Playback requests are queued up, so you may issue multiple Playback requests without waiting for completion.
All about Playback
Tracking Playback Progress
Logic editor margin area: Shows the status of playback, at a statement level:
• Queued up
• Running
• Completed , Failed
• Completed, Done
Playback Toolbar: Indicates if any Playback is in progress in any Action/Scenario. Click for the Queue.
• Stop/terminate Playback requests if needed.
Note When Playback is stopped, currently executing statement will always run to completion.
Playback Settings
• Self-healing on/off
Hands-on
15 mins
Successful recreation of work is pre-requisite
for the rest of the session
Assignment
Example Scenario: Verify one-way flight booking
Write down examples of at least 2 Scenarios
in your own Application with following Step # Step Name (Action) Page Name (Context) Parameters
details. Choose Scenarios that consist of at
least 5 steps each. 1 Search for a flight Home Page
Origin, Destination, Travel Date,
Class of Service
• Names of steps (Actions) in each Scenario, as per 2 Select a flight Flight Results Page Preferred Airline
best practices.
3 Review Itinerary Itinerary Display Page Expected Price
• Parameters you can think of, for each Action
• Page Names where these steps are happening
4 Proceed to Checkout Itinerary Display Page
• Go ahead and Automate these Scenarios to the 5 Pay for the flight Payment Page Name, Credit Card Number
extent possible!
Best Practices