SlideShare a Scribd company logo
© 2021 Maveryx srl.
All rights reserved.
How to easily design
and
automate a test case
© 2021 Maveryx srl.
All rights reserved.
Summary
• Functional black box testing
• Functional test design & implementation (automation)
• The Google Search example
• Conclusion
© 2021 Maveryx srl.
All rights reserved.
Functional Testing
• Functional testing verifies that all functionality of the
application under test operate in conformance with their stated
and implicit specification
• Functional testing checks whether the application under test "do what
is supposed to do“
• (“Alternatively”) Functional testing is the process of attempting
to find discrepancies between the application and its
specification
© 2021 Maveryx srl.
All rights reserved.
Black-box Testing
• Black-box testing examines the functionality of an application
without peering into its internal structure.
• Completely unconcerned about the internal structure and behavior of
the application being tested.
© 2021 Maveryx srl.
All rights reserved.
Functional Black-box Testing
• Functional black-box testing is a
process of attempting to show
that an application matches its
functional specifications, by
ignoring its internal structure.
• Functionality are tested by
providing them inputs and
examining the outputs against the
functional requirements
• The implementation is not known
© 2021 Maveryx srl.
All rights reserved.
What is a test automation?
• In software testing, test automation is the use of a software (called
test automation tool) separated from the software being tested, to
control the execution of tests and the comparison of actual
outcomes with predicted outcomes.
© 2021 Maveryx srl.
All rights reserved.
What is a test automation?
• Test Automation is a type of testing in which a software tool
executes without human intervention a set of test scripts by:
• performing test actions against the application under test
• comparing the actual results to the expected behavior
• creating test reports
© 2021 Maveryx srl.
All rights reserved.
Benefits of test automation
• Test automation is used to repeat more and more times tasks that
are laborious and time-consuming to do manually
• Automated tests can be run quickly and repeatedly and are more
reliable than manual testing approaches
• Numerous open-source and commercial testing tools exist for all
types of testing (functional, UI, performance, security...) and for all
kinds of applications like desktop, web, and mobile
© 2021 Maveryx srl.
All rights reserved.
The Demo Application: Google Search
• For the purposes of this tutorial Google Search is used.
© 2021 Maveryx srl.
All rights reserved.
Design Test Case
• Use Case
1. Go to google.com (Google Search page)
2. Type "Maveryx" into the search box
3. Click 'Google Search' button to view results
4. Click on the first result (Maveryx website)
© 2021 Maveryx srl.
All rights reserved.
Design Test Case
TEST ACTION EXPECTED OUTCOME
Launch browser and navigate to Google
page at https://www.google.com/
Google search page is displayed
Type "Maveryx" into the search box "Maveryx" is typed into the search box
Click 'Google Search' button to start
searching
Search results are displayed
Click on the first result Maveryx homepage is displayed
This test can be executed manually, or it can be automated
© 2021 Maveryx srl.
All rights reserved.
Design Test Script
1. Launch Chrome browser
2. Navigate to URL https://www.google.com/en
3. Assert that the Google search page is displayed
4. Type "Maveryx" into the search box
5. Assert that the string "Maveryx" is typed into the
search box
6. Click the 'Google Search' button
7. Check that the search results are displayed
8. Click on the first result (Maveryx homepage)
9. Check that the Maveryx homepage is displayed
© 2021 Maveryx srl.
All rights reserved.
Launch browser and Navigate to the website
To open the Google Search in Chrome browser, create an XML “launch” file like:
In the Java test script add the following lines:
//the Chrome->Google Search launch file path
final String chromeGoogleSearch = System.getProperty("user.dir")+"dataGoogle.xml";
//launch Chrome browser and navigate to Google Search
Bootstrap.startApplication(chromeGoogleSearch);
<?xml version="1.0" encoding="UTF-8"?>
<AUT_DATA>
<EXECUTABLE_PATH></EXECUTABLE_PATH>
<APPLICATION_NAME>CHROME</APPLICATION_NAME>
<TOOLKIT>WEB</TOOLKIT>
<AUT_ARGUMENTS>https://www.google.com/en</AUT_ARGUMENTS>
</AUT_DATA>
© 2021 Maveryx srl.
All rights reserved.
Working with the HTML elements
• To work with the web elements such as buttons, texts, etc.
1. Locate the HTML elements to test
2. Perform the test action
• To locate the HTML element to test, Maveryx does NOT use neither
"GUI Maps" nor "Locators".
With Maveryx you can locate the HTML element to test specifying
• identifier (e.g. name, id, title, caption, …)
• type (e.g. button, text, drop-down list, label, …)
© 2021 Maveryx srl.
All rights reserved.
Locate the HTML elements
The search text box can be identified by its title = "Search"
The search button can be identified by its caption "Google Search"
identifier
type
type identifier
//the 'Search' text box
GuiText searchBox = new GuiText("Search");
//'Google Search' button
GuiButton search = new GuiButton("Google Search");
© 2021 Maveryx srl.
All rights reserved.
Perform test actions
Once located the HTML element you can perform the relevant test action.
In this test:
• enter text into the search box
• click the ‘Google Search’ button
• click an hyperlink (the first search result)
//the Search text box
GuiText searchBox = new GuiText("Search");
searchBox.setText(searchKey);//type the search term
//the 'Google Search' button
GuiButton search = new GuiButton("Google Search");
search.click(); //click the 'Google Search' button
//the first item of the search result page
GuiHyperlink result = new GuiHyperlink("Maveryx-Test Automation Tool for GUI Testing");
result.click(); //click it
© 2021 Maveryx srl.
All rights reserved.
Check the Results: Assertions
• To compare expected outcomes and the actual outcomes,
assertions can be added to the test script
• expected results = actual results  the test case is PASSED
• expected results ≠ actual results  the test case is FAILED
//check that the string "Maveryx" is inserted into the search box
assertEquals(searchKey, searchBox.getText());
String expectedURL = "https://www.maveryx.com/";
assertEquals(expectedURL, new GuiBrowser().getCurrentPageUrl());//check the
(landing) page url
© 2021 Maveryx srl.
All rights reserved.
Check the Results: WaitForObject
• Checking if a test object is present or not in the web page
• The waitForObject function waits until the given object exists.
• Returns if successful (the test object is present)
• Raises an ObjectNotFoundException on failure, if the function times out and the
test object is not present
//the Search text box
GuiText searchBox = new GuiText("Search");
//check that the search textbox is present
searchBox.waitForObject(3, 1);
//check whether the landing page is the Maveryx website
new GuiHtmlElement("Trailblazing Functional Automated UI
Testing").waitForObject(3, 1);//the main message is displayed
© 2021 Maveryx srl.
All rights reserved.
Conclusion
• Functional black-box testing is the process of attempting to show that
an application matches its specifications, ignoring its implementation
• Start designing the test case than automate it. Remember that to each
test action shall correspond an expected response.
• Automated test scripts in case of web pages or web applications
includes
• identifying web elements
• acting on web elements
• asserting on expected outputs vs. actual outcomes

More Related Content

PDF
User Interface Testing. What is UI Testing and Why it is so important?
PDF
Testing Banking Applications. Here is a practical example
PDF
Build your first rpa bot using IBM RPA automation
PPTX
Breaking free from static abuse in test automation frameworks and using Sprin...
PPTX
Bdd with Cucumber and Mocha
PPTX
Bridging the communication Gap & Continuous Delivery
PDF
Lecture 12: React-Native Firebase Authentication
KEY
Introduction to ASP.NET MVC
User Interface Testing. What is UI Testing and Why it is so important?
Testing Banking Applications. Here is a practical example
Build your first rpa bot using IBM RPA automation
Breaking free from static abuse in test automation frameworks and using Sprin...
Bdd with Cucumber and Mocha
Bridging the communication Gap & Continuous Delivery
Lecture 12: React-Native Firebase Authentication
Introduction to ASP.NET MVC

What's hot (20)

PPTX
Tools to Test Ecommerce Website
PPTX
Katalon Studio - GUI Overview
PDF
Ecommerce Website Testing Checklist
PDF
ForwardJS 2017 - Fullstack end-to-end Test Automation with node.js
ODP
Why Katalon Studio?
PPT
introduction to Angularjs basics
DOCX
Creation of simple application using - step by step
PPTX
Using Page Objects
PPT
TESTING Checklist
PPT
Test Automation Framework Development Introduction
PDF
Aspnet mvc tutorial_01_cs
DOCX
Setting up an odi agent
PDF
Top 7 Angular Best Practices to Organize Your Angular App
PDF
Rc085 010d-vaadin7
PDF
Beginning AngularJS
PPTX
Protractor Testing Automation Tool Framework / Jasmine Reporters
PDF
Asp net-mvc-3 tier
DOCX
How to convert custom plsql to web services-Soap OR Rest
DOCX
Window Desktop Application Testing
PDF
Secure mvc application saineshwar
Tools to Test Ecommerce Website
Katalon Studio - GUI Overview
Ecommerce Website Testing Checklist
ForwardJS 2017 - Fullstack end-to-end Test Automation with node.js
Why Katalon Studio?
introduction to Angularjs basics
Creation of simple application using - step by step
Using Page Objects
TESTING Checklist
Test Automation Framework Development Introduction
Aspnet mvc tutorial_01_cs
Setting up an odi agent
Top 7 Angular Best Practices to Organize Your Angular App
Rc085 010d-vaadin7
Beginning AngularJS
Protractor Testing Automation Tool Framework / Jasmine Reporters
Asp net-mvc-3 tier
How to convert custom plsql to web services-Soap OR Rest
Window Desktop Application Testing
Secure mvc application saineshwar
Ad

Similar to How to easily design and automate test cases.pdf (20)

PDF
Stf 2019 workshop - enhanced test automation for web and desktop apps
PDF
Codeless Web testing: a keyword-driven example with Excel
PDF
Web testing
PDF
Maveryx presentation
PDF
Keywords-driven testing vs Scripted automation
PDF
Testing Java applications with Maveryx
PDF
Does my test script smell?
PPTX
Mobile Automation Basic Concepts / Demo
PPT
A perspective on web testing
PPT
A perspective on web testing
PDF
A Modern Dive into QA Automation and Beyond
PDF
Java Test Automation for REST, Web and Mobile
PDF
Testing Android applications with Maveryx
PDF
Mastering Software Test Automation: A Comprehensive Guide for Beginners and E...
PPTX
Module 4.pptxbsbsnsnsnsbsbbsjsjzbsbbsbsbsbs
PDF
GUI, Performance, Load and API testing with Test Studio
PDF
Implementing Test Automation in Agile Projects
PDF
Fostering Long-Term Test Automation Success
PDF
Techieguide
PDF
Gwo Techieguide
 
Stf 2019 workshop - enhanced test automation for web and desktop apps
Codeless Web testing: a keyword-driven example with Excel
Web testing
Maveryx presentation
Keywords-driven testing vs Scripted automation
Testing Java applications with Maveryx
Does my test script smell?
Mobile Automation Basic Concepts / Demo
A perspective on web testing
A perspective on web testing
A Modern Dive into QA Automation and Beyond
Java Test Automation for REST, Web and Mobile
Testing Android applications with Maveryx
Mastering Software Test Automation: A Comprehensive Guide for Beginners and E...
Module 4.pptxbsbsnsnsnsbsbbsjsjzbsbbsbsbsbs
GUI, Performance, Load and API testing with Test Studio
Implementing Test Automation in Agile Projects
Fostering Long-Term Test Automation Success
Techieguide
Gwo Techieguide
 
Ad

Recently uploaded (20)

PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
How Creative Agencies Leverage Project Management Software.pdf
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PPTX
L1 - Introduction to python Backend.pptx
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
Understanding Forklifts - TECH EHS Solution
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
medical staffing services at VALiNTRY
PDF
Softaken Excel to vCard Converter Software.pdf
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PPTX
history of c programming in notes for students .pptx
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PPTX
Introduction to Artificial Intelligence
PDF
System and Network Administration Chapter 2
PPTX
Essential Infomation Tech presentation.pptx
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PDF
Digital Strategies for Manufacturing Companies
Internet Downloader Manager (IDM) Crack 6.42 Build 41
How Creative Agencies Leverage Project Management Software.pdf
Adobe Illustrator 28.6 Crack My Vision of Vector Design
L1 - Introduction to python Backend.pptx
Operating system designcfffgfgggggggvggggggggg
Understanding Forklifts - TECH EHS Solution
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
Odoo Companies in India – Driving Business Transformation.pdf
medical staffing services at VALiNTRY
Softaken Excel to vCard Converter Software.pdf
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
history of c programming in notes for students .pptx
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Navsoft: AI-Powered Business Solutions & Custom Software Development
Introduction to Artificial Intelligence
System and Network Administration Chapter 2
Essential Infomation Tech presentation.pptx
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
Digital Strategies for Manufacturing Companies

How to easily design and automate test cases.pdf

  • 1. © 2021 Maveryx srl. All rights reserved. How to easily design and automate a test case
  • 2. © 2021 Maveryx srl. All rights reserved. Summary • Functional black box testing • Functional test design & implementation (automation) • The Google Search example • Conclusion
  • 3. © 2021 Maveryx srl. All rights reserved. Functional Testing • Functional testing verifies that all functionality of the application under test operate in conformance with their stated and implicit specification • Functional testing checks whether the application under test "do what is supposed to do“ • (“Alternatively”) Functional testing is the process of attempting to find discrepancies between the application and its specification
  • 4. © 2021 Maveryx srl. All rights reserved. Black-box Testing • Black-box testing examines the functionality of an application without peering into its internal structure. • Completely unconcerned about the internal structure and behavior of the application being tested.
  • 5. © 2021 Maveryx srl. All rights reserved. Functional Black-box Testing • Functional black-box testing is a process of attempting to show that an application matches its functional specifications, by ignoring its internal structure. • Functionality are tested by providing them inputs and examining the outputs against the functional requirements • The implementation is not known
  • 6. © 2021 Maveryx srl. All rights reserved. What is a test automation? • In software testing, test automation is the use of a software (called test automation tool) separated from the software being tested, to control the execution of tests and the comparison of actual outcomes with predicted outcomes.
  • 7. © 2021 Maveryx srl. All rights reserved. What is a test automation? • Test Automation is a type of testing in which a software tool executes without human intervention a set of test scripts by: • performing test actions against the application under test • comparing the actual results to the expected behavior • creating test reports
  • 8. © 2021 Maveryx srl. All rights reserved. Benefits of test automation • Test automation is used to repeat more and more times tasks that are laborious and time-consuming to do manually • Automated tests can be run quickly and repeatedly and are more reliable than manual testing approaches • Numerous open-source and commercial testing tools exist for all types of testing (functional, UI, performance, security...) and for all kinds of applications like desktop, web, and mobile
  • 9. © 2021 Maveryx srl. All rights reserved. The Demo Application: Google Search • For the purposes of this tutorial Google Search is used.
  • 10. © 2021 Maveryx srl. All rights reserved. Design Test Case • Use Case 1. Go to google.com (Google Search page) 2. Type "Maveryx" into the search box 3. Click 'Google Search' button to view results 4. Click on the first result (Maveryx website)
  • 11. © 2021 Maveryx srl. All rights reserved. Design Test Case TEST ACTION EXPECTED OUTCOME Launch browser and navigate to Google page at https://www.google.com/ Google search page is displayed Type "Maveryx" into the search box "Maveryx" is typed into the search box Click 'Google Search' button to start searching Search results are displayed Click on the first result Maveryx homepage is displayed This test can be executed manually, or it can be automated
  • 12. © 2021 Maveryx srl. All rights reserved. Design Test Script 1. Launch Chrome browser 2. Navigate to URL https://www.google.com/en 3. Assert that the Google search page is displayed 4. Type "Maveryx" into the search box 5. Assert that the string "Maveryx" is typed into the search box 6. Click the 'Google Search' button 7. Check that the search results are displayed 8. Click on the first result (Maveryx homepage) 9. Check that the Maveryx homepage is displayed
  • 13. © 2021 Maveryx srl. All rights reserved. Launch browser and Navigate to the website To open the Google Search in Chrome browser, create an XML “launch” file like: In the Java test script add the following lines: //the Chrome->Google Search launch file path final String chromeGoogleSearch = System.getProperty("user.dir")+"dataGoogle.xml"; //launch Chrome browser and navigate to Google Search Bootstrap.startApplication(chromeGoogleSearch); <?xml version="1.0" encoding="UTF-8"?> <AUT_DATA> <EXECUTABLE_PATH></EXECUTABLE_PATH> <APPLICATION_NAME>CHROME</APPLICATION_NAME> <TOOLKIT>WEB</TOOLKIT> <AUT_ARGUMENTS>https://www.google.com/en</AUT_ARGUMENTS> </AUT_DATA>
  • 14. © 2021 Maveryx srl. All rights reserved. Working with the HTML elements • To work with the web elements such as buttons, texts, etc. 1. Locate the HTML elements to test 2. Perform the test action • To locate the HTML element to test, Maveryx does NOT use neither "GUI Maps" nor "Locators". With Maveryx you can locate the HTML element to test specifying • identifier (e.g. name, id, title, caption, …) • type (e.g. button, text, drop-down list, label, …)
  • 15. © 2021 Maveryx srl. All rights reserved. Locate the HTML elements The search text box can be identified by its title = "Search" The search button can be identified by its caption "Google Search" identifier type type identifier //the 'Search' text box GuiText searchBox = new GuiText("Search"); //'Google Search' button GuiButton search = new GuiButton("Google Search");
  • 16. © 2021 Maveryx srl. All rights reserved. Perform test actions Once located the HTML element you can perform the relevant test action. In this test: • enter text into the search box • click the ‘Google Search’ button • click an hyperlink (the first search result) //the Search text box GuiText searchBox = new GuiText("Search"); searchBox.setText(searchKey);//type the search term //the 'Google Search' button GuiButton search = new GuiButton("Google Search"); search.click(); //click the 'Google Search' button //the first item of the search result page GuiHyperlink result = new GuiHyperlink("Maveryx-Test Automation Tool for GUI Testing"); result.click(); //click it
  • 17. © 2021 Maveryx srl. All rights reserved. Check the Results: Assertions • To compare expected outcomes and the actual outcomes, assertions can be added to the test script • expected results = actual results  the test case is PASSED • expected results ≠ actual results  the test case is FAILED //check that the string "Maveryx" is inserted into the search box assertEquals(searchKey, searchBox.getText()); String expectedURL = "https://www.maveryx.com/"; assertEquals(expectedURL, new GuiBrowser().getCurrentPageUrl());//check the (landing) page url
  • 18. © 2021 Maveryx srl. All rights reserved. Check the Results: WaitForObject • Checking if a test object is present or not in the web page • The waitForObject function waits until the given object exists. • Returns if successful (the test object is present) • Raises an ObjectNotFoundException on failure, if the function times out and the test object is not present //the Search text box GuiText searchBox = new GuiText("Search"); //check that the search textbox is present searchBox.waitForObject(3, 1); //check whether the landing page is the Maveryx website new GuiHtmlElement("Trailblazing Functional Automated UI Testing").waitForObject(3, 1);//the main message is displayed
  • 19. © 2021 Maveryx srl. All rights reserved. Conclusion • Functional black-box testing is the process of attempting to show that an application matches its specifications, ignoring its implementation • Start designing the test case than automate it. Remember that to each test action shall correspond an expected response. • Automated test scripts in case of web pages or web applications includes • identifying web elements • acting on web elements • asserting on expected outputs vs. actual outcomes