SlideShare a Scribd company logo
1 of 19
Download to read offline
© 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

What's hot

Katalon Studio - GUI Overview
Katalon Studio - GUI OverviewKatalon Studio - GUI Overview
Katalon Studio - GUI OverviewKatalon Studio
 
ForwardJS 2017 - Fullstack end-to-end Test Automation with node.js
ForwardJS 2017 -  Fullstack end-to-end Test Automation with node.jsForwardJS 2017 -  Fullstack end-to-end Test Automation with node.js
ForwardJS 2017 - Fullstack end-to-end Test Automation with node.jsMek Srunyu Stittri
 
Why Katalon Studio?
Why Katalon Studio?Why Katalon Studio?
Why Katalon Studio?Knoldus Inc.
 
introduction to Angularjs basics
introduction to Angularjs basicsintroduction to Angularjs basics
introduction to Angularjs basicsRavindra K
 
Creation of simple application using - step by step
Creation of simple application using - step by stepCreation of simple application using - step by step
Creation of simple application using - step by steppriya Nithya
 
Using Page Objects
Using Page ObjectsUsing Page Objects
Using Page ObjectsGetch88
 
TESTING Checklist
TESTING Checklist TESTING Checklist
TESTING Checklist Febin Chacko
 
Test Automation Framework Development Introduction
Test Automation Framework Development IntroductionTest Automation Framework Development Introduction
Test Automation Framework Development IntroductionGanuka Yashantha
 
Aspnet mvc tutorial_01_cs
Aspnet mvc tutorial_01_csAspnet mvc tutorial_01_cs
Aspnet mvc tutorial_01_csAlfa Gama Omega
 
Top 7 Angular Best Practices to Organize Your Angular App
Top 7 Angular Best Practices to Organize Your Angular AppTop 7 Angular Best Practices to Organize Your Angular App
Top 7 Angular Best Practices to Organize Your Angular AppKaty Slemon
 
Rc085 010d-vaadin7
Rc085 010d-vaadin7Rc085 010d-vaadin7
Rc085 010d-vaadin7Cosmina Ivan
 
Beginning AngularJS
Beginning AngularJSBeginning AngularJS
Beginning AngularJSTroy Miles
 
Protractor Testing Automation Tool Framework / Jasmine Reporters
Protractor Testing Automation Tool Framework / Jasmine ReportersProtractor Testing Automation Tool Framework / Jasmine Reporters
Protractor Testing Automation Tool Framework / Jasmine ReportersHaitham Refaat
 
How to convert custom plsql to web services-Soap OR Rest
How to convert custom plsql to web services-Soap OR RestHow to convert custom plsql to web services-Soap OR Rest
How to convert custom plsql to web services-Soap OR Restshravan kumar chelika
 
Window Desktop Application Testing
Window Desktop Application TestingWindow Desktop Application Testing
Window Desktop Application TestingTrupti Jethva
 
Secure mvc application saineshwar
Secure mvc application   saineshwarSecure mvc application   saineshwar
Secure mvc application saineshwarSaineshwar bageri
 

What's hot (20)

Tools to Test Ecommerce Website
Tools to Test Ecommerce WebsiteTools to Test Ecommerce Website
Tools to Test Ecommerce Website
 
Katalon Studio - GUI Overview
Katalon Studio - GUI OverviewKatalon Studio - GUI Overview
Katalon Studio - GUI Overview
 
Ecommerce Website Testing Checklist
Ecommerce Website Testing ChecklistEcommerce Website Testing Checklist
Ecommerce Website Testing Checklist
 
ForwardJS 2017 - Fullstack end-to-end Test Automation with node.js
ForwardJS 2017 -  Fullstack end-to-end Test Automation with node.jsForwardJS 2017 -  Fullstack end-to-end Test Automation with node.js
ForwardJS 2017 - Fullstack end-to-end Test Automation with node.js
 
Why Katalon Studio?
Why Katalon Studio?Why Katalon Studio?
Why Katalon Studio?
 
introduction to Angularjs basics
introduction to Angularjs basicsintroduction to Angularjs basics
introduction to Angularjs basics
 
Creation of simple application using - step by step
Creation of simple application using - step by stepCreation of simple application using - step by step
Creation of simple application using - step by step
 
Using Page Objects
Using Page ObjectsUsing Page Objects
Using Page Objects
 
TESTING Checklist
TESTING Checklist TESTING Checklist
TESTING Checklist
 
Test Automation Framework Development Introduction
Test Automation Framework Development IntroductionTest Automation Framework Development Introduction
Test Automation Framework Development Introduction
 
Aspnet mvc tutorial_01_cs
Aspnet mvc tutorial_01_csAspnet mvc tutorial_01_cs
Aspnet mvc tutorial_01_cs
 
Setting up an odi agent
Setting up an odi agentSetting up an odi agent
Setting up an odi agent
 
Top 7 Angular Best Practices to Organize Your Angular App
Top 7 Angular Best Practices to Organize Your Angular AppTop 7 Angular Best Practices to Organize Your Angular App
Top 7 Angular Best Practices to Organize Your Angular App
 
Rc085 010d-vaadin7
Rc085 010d-vaadin7Rc085 010d-vaadin7
Rc085 010d-vaadin7
 
Beginning AngularJS
Beginning AngularJSBeginning AngularJS
Beginning AngularJS
 
Protractor Testing Automation Tool Framework / Jasmine Reporters
Protractor Testing Automation Tool Framework / Jasmine ReportersProtractor Testing Automation Tool Framework / Jasmine Reporters
Protractor Testing Automation Tool Framework / Jasmine Reporters
 
Asp net-mvc-3 tier
Asp net-mvc-3 tierAsp net-mvc-3 tier
Asp net-mvc-3 tier
 
How to convert custom plsql to web services-Soap OR Rest
How to convert custom plsql to web services-Soap OR RestHow to convert custom plsql to web services-Soap OR Rest
How to convert custom plsql to web services-Soap OR Rest
 
Window Desktop Application Testing
Window Desktop Application TestingWindow Desktop Application Testing
Window Desktop Application Testing
 
Secure mvc application saineshwar
Secure mvc application   saineshwarSecure mvc application   saineshwar
Secure mvc application saineshwar
 

Similar to How to easily design and automate test cases.pdf

Web testing
Web testingWeb testing
Web testingMaveryx
 
Fostering Long-Term Test Automation Success
Fostering Long-Term Test Automation SuccessFostering Long-Term Test Automation Success
Fostering Long-Term Test Automation SuccessJosiah Renaudin
 
Stf 2019 workshop - enhanced test automation for web and desktop apps
Stf 2019   workshop - enhanced test automation for web and desktop appsStf 2019   workshop - enhanced test automation for web and desktop apps
Stf 2019 workshop - enhanced test automation for web and desktop appsMaveryx
 
CV_Sachin_11Years_Automation_Performance
CV_Sachin_11Years_Automation_PerformanceCV_Sachin_11Years_Automation_Performance
CV_Sachin_11Years_Automation_PerformanceSachin Kodagali
 
Unit Testing in Flutter - From Workflow Essentials to Complex Scenarios
Unit Testing in Flutter - From Workflow Essentials to Complex ScenariosUnit Testing in Flutter - From Workflow Essentials to Complex Scenarios
Unit Testing in Flutter - From Workflow Essentials to Complex ScenariosFlutter Agency
 
Advanced Coded UI Testing
Advanced Coded UI TestingAdvanced Coded UI Testing
Advanced Coded UI TestingShai Raiten
 
WebTest - Efficient Functional Web Testing with HtmlUnit and Beyond
WebTest - Efficient Functional Web Testing with HtmlUnit and BeyondWebTest - Efficient Functional Web Testing with HtmlUnit and Beyond
WebTest - Efficient Functional Web Testing with HtmlUnit and Beyondmguillem
 
Selenium and JMeter Testing
Selenium and JMeter TestingSelenium and JMeter Testing
Selenium and JMeter TestingArchanaKalapgar
 
Use Jenkins For Continuous Load Testing And Mobile Test Automation
Use Jenkins For Continuous Load Testing And Mobile Test AutomationUse Jenkins For Continuous Load Testing And Mobile Test Automation
Use Jenkins For Continuous Load Testing And Mobile Test AutomationClever Moe
 
Anatomy of a Build Pipeline
Anatomy of a Build PipelineAnatomy of a Build Pipeline
Anatomy of a Build PipelineSamuel Brown
 
Integrating Selenium testing infrastructure into Scala Project
Integrating Selenium testing infrastructure into Scala ProjectIntegrating Selenium testing infrastructure into Scala Project
Integrating Selenium testing infrastructure into Scala ProjectKnoldus Inc.
 
IRJET- Automatic Device Functional Testing
IRJET- Automatic Device Functional TestingIRJET- Automatic Device Functional Testing
IRJET- Automatic Device Functional TestingIRJET Journal
 
STARWest: Use Jenkins For Continuous 
Load Testing And Mobile Test Automation
STARWest: Use Jenkins For Continuous 
Load Testing And Mobile Test AutomationSTARWest: Use Jenkins For Continuous 
Load Testing And Mobile Test Automation
STARWest: Use Jenkins For Continuous 
Load Testing And Mobile Test AutomationClever Moe
 
Test automation lesson
Test automation lessonTest automation lesson
Test automation lessonSadaaki Emura
 
JavaOne2016 #CON5929 Time-Saving Tips and Tricks for Building Quality Java Ap...
JavaOne2016 #CON5929 Time-Saving Tips and Tricks for Building Quality Java Ap...JavaOne2016 #CON5929 Time-Saving Tips and Tricks for Building Quality Java Ap...
JavaOne2016 #CON5929 Time-Saving Tips and Tricks for Building Quality Java Ap...Yusuke Yamamoto
 
Codeless Web testing: a keyword-driven example with Excel
Codeless Web testing: a keyword-driven example with ExcelCodeless Web testing: a keyword-driven example with Excel
Codeless Web testing: a keyword-driven example with ExcelMaveryx
 
A Complete Guide to Functional Testing
A Complete Guide to Functional TestingA Complete Guide to Functional Testing
A Complete Guide to Functional TestingMatthew Allen
 

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

Web testing
Web testingWeb testing
Web testing
 
Fostering Long-Term Test Automation Success
Fostering Long-Term Test Automation SuccessFostering Long-Term Test Automation Success
Fostering Long-Term Test Automation Success
 
Stf 2019 workshop - enhanced test automation for web and desktop apps
Stf 2019   workshop - enhanced test automation for web and desktop appsStf 2019   workshop - enhanced test automation for web and desktop apps
Stf 2019 workshop - enhanced test automation for web and desktop apps
 
CV_Sachin_11Years_Automation_Performance
CV_Sachin_11Years_Automation_PerformanceCV_Sachin_11Years_Automation_Performance
CV_Sachin_11Years_Automation_Performance
 
Unit Testing in Flutter - From Workflow Essentials to Complex Scenarios
Unit Testing in Flutter - From Workflow Essentials to Complex ScenariosUnit Testing in Flutter - From Workflow Essentials to Complex Scenarios
Unit Testing in Flutter - From Workflow Essentials to Complex Scenarios
 
Advanced Coded UI Testing
Advanced Coded UI TestingAdvanced Coded UI Testing
Advanced Coded UI Testing
 
WebTest - Efficient Functional Web Testing with HtmlUnit and Beyond
WebTest - Efficient Functional Web Testing with HtmlUnit and BeyondWebTest - Efficient Functional Web Testing with HtmlUnit and Beyond
WebTest - Efficient Functional Web Testing with HtmlUnit and Beyond
 
Selenium and JMeter Testing
Selenium and JMeter TestingSelenium and JMeter Testing
Selenium and JMeter Testing
 
Selenium and JMeter
Selenium and JMeterSelenium and JMeter
Selenium and JMeter
 
Use Jenkins For Continuous Load Testing And Mobile Test Automation
Use Jenkins For Continuous Load Testing And Mobile Test AutomationUse Jenkins For Continuous Load Testing And Mobile Test Automation
Use Jenkins For Continuous Load Testing And Mobile Test Automation
 
Anatomy of a Build Pipeline
Anatomy of a Build PipelineAnatomy of a Build Pipeline
Anatomy of a Build Pipeline
 
Integrating Selenium testing infrastructure into Scala Project
Integrating Selenium testing infrastructure into Scala ProjectIntegrating Selenium testing infrastructure into Scala Project
Integrating Selenium testing infrastructure into Scala Project
 
IRJET- Automatic Device Functional Testing
IRJET- Automatic Device Functional TestingIRJET- Automatic Device Functional Testing
IRJET- Automatic Device Functional Testing
 
Shyam
ShyamShyam
Shyam
 
Testing Angular
Testing AngularTesting Angular
Testing Angular
 
STARWest: Use Jenkins For Continuous 
Load Testing And Mobile Test Automation
STARWest: Use Jenkins For Continuous 
Load Testing And Mobile Test AutomationSTARWest: Use Jenkins For Continuous 
Load Testing And Mobile Test Automation
STARWest: Use Jenkins For Continuous 
Load Testing And Mobile Test Automation
 
Test automation lesson
Test automation lessonTest automation lesson
Test automation lesson
 
JavaOne2016 #CON5929 Time-Saving Tips and Tricks for Building Quality Java Ap...
JavaOne2016 #CON5929 Time-Saving Tips and Tricks for Building Quality Java Ap...JavaOne2016 #CON5929 Time-Saving Tips and Tricks for Building Quality Java Ap...
JavaOne2016 #CON5929 Time-Saving Tips and Tricks for Building Quality Java Ap...
 
Codeless Web testing: a keyword-driven example with Excel
Codeless Web testing: a keyword-driven example with ExcelCodeless Web testing: a keyword-driven example with Excel
Codeless Web testing: a keyword-driven example with Excel
 
A Complete Guide to Functional Testing
A Complete Guide to Functional TestingA Complete Guide to Functional Testing
A Complete Guide to Functional Testing
 

More from Maveryx

Keywords-driven testing vs Scripted automation
Keywords-driven testing vs Scripted automationKeywords-driven testing vs Scripted automation
Keywords-driven testing vs Scripted automationMaveryx
 
Maveryx presentation
Maveryx presentationMaveryx presentation
Maveryx presentationMaveryx
 
Keyword Driven Testing
Keyword Driven TestingKeyword Driven Testing
Keyword Driven TestingMaveryx
 
Data Driven Testing
Data Driven TestingData Driven Testing
Data Driven TestingMaveryx
 
Testing Android applications with Maveryx
Testing Android applications with MaveryxTesting Android applications with Maveryx
Testing Android applications with MaveryxMaveryx
 
Testing Java applications with Maveryx
Testing Java applications with MaveryxTesting Java applications with Maveryx
Testing Java applications with MaveryxMaveryx
 
Maveryx - Product Presentation
Maveryx - Product PresentationMaveryx - Product Presentation
Maveryx - Product PresentationMaveryx
 

More from Maveryx (7)

Keywords-driven testing vs Scripted automation
Keywords-driven testing vs Scripted automationKeywords-driven testing vs Scripted automation
Keywords-driven testing vs Scripted automation
 
Maveryx presentation
Maveryx presentationMaveryx presentation
Maveryx presentation
 
Keyword Driven Testing
Keyword Driven TestingKeyword Driven Testing
Keyword Driven Testing
 
Data Driven Testing
Data Driven TestingData Driven Testing
Data Driven Testing
 
Testing Android applications with Maveryx
Testing Android applications with MaveryxTesting Android applications with Maveryx
Testing Android applications with Maveryx
 
Testing Java applications with Maveryx
Testing Java applications with MaveryxTesting Java applications with Maveryx
Testing Java applications with Maveryx
 
Maveryx - Product Presentation
Maveryx - Product PresentationMaveryx - Product Presentation
Maveryx - Product Presentation
 

Recently uploaded

Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...Technogeeks
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odishasmiwainfosol
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
How to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfHow to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfLivetecs LLC
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 

Recently uploaded (20)

Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
How to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfHow to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdf
 
2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 

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