SlideShare una empresa de Scribd logo
1 de 36
AUTOMATED SYSTEM
TESTS FOR JOOMLA
Puneet Kala
OUTLINE
 What is System Testing?
 How is automation testing used in Joomla?
 How do I set up my PC to run system tests?
 How do I write system tests for my extension?
SOME BASIC QUESTION
 What is Automated testing?
 Running programs to test other programs
 What is PHPunit?
 A library used for creating PHP unit tests
 What is Selenium?
 A program which is used for creating System Tests,
Automating browsers
 What is Xpath?
 A syntax for navigating elements in a web page
AUTOMATED TESTING IN JOOMLA
 Webdriver Tests was started in Nov, 2012, by
Mark Dexter
 Backend CMS tests along with Selenium
Webdriver were developed as part of GSOC,2013.
 Frontend CMS Tests are being developed as part
of GSOC, 2014.
DEVELOPER’S NIGHTMARE
HOW TO AVOID?
WHY DO WE NEED AUTOMATION
TESTING
 Helps in preventing software release with
obvious bugs
 Allows you to integrate continuous testing into
your development process
 Saves a lot of time
 Reliable
 Cost reduction
ALTERNATIVE TO AUTOMATION
TESTING
SYSTEM TESTING
 Test at the user level from outside the program
 Testing a process for example: testing user
creations, testing Tag creations
 Running the application and testing it just like a
user would do.
SETUP TO RUN SYSTEM TESTS
 PHPUnit 3.6 or higher (latest is 4.1) Use PHAR
to install.
 PHP 5.3.8 (required for Webdriver system tests)
 Curl package (extension=php_curl.dll or
php_curl.so in php.ini)
SETUP TO RUN SYSTEM TESTS-2
 Download Selenium Server (Java ".jar") from
seleniumhq.com
 run in background
 Checkout Joomla from Github.com
 Create configdef.php file (tests/system/servers)
 used for old and new tests
FILE STRUCTURE
EXECUTE SYSTEM TESTS
 Run Selenium Server in the background
 do once and let it run
 Change to desired folder
 Webdriver System: tests/system/webdriver/tests
 phpunit <optional name of sub-folder or file>
TEST CONFIGURATION
 phpunit.xml.dist / phpunit.xml
 .dist is included in Git, .xml is local only
 configdef.php.dist is generic
 need to create configdef.php file with local values
LETS LOOK AT A DEMO
 Installation Tests
 Tag Manager Tests
SELENIUM WEBDRIVER VS
SELENIUM IDE
 IDE is a record and playback tool, which is not
reliable as compared to Selenium Webdriver.
 Selenium IDE tests require huge amount of
Maintenance
 Webdriver has a Object Oriented API
 It is difficult to use Selenium IDE for checking
complex test cases involving dynamic contents
 No Programming logic (like loops, conditional
statements) can be applied in Selenium IDE.
ANATOMY OF WEBDRIVER TEST
CLASS
PAGE OBJECT DESIGN PATTERN
PAGE CLASSES
 Classes that contains specific details about the
Joomla page
 $waitForXpath: identifies this page
 $url: URL for the page
 Elements: toolbar, input elements, menu elements
 Methods specific to the page:
 For example: TagManagerPage would contain functions like
createTag(), editTag(), deleteTag(), searchTag()
 Page classes do not perform any assertions, it is
the job of test class to perform assertions.
 Re-Usable/Maintainable code
TEST DETAIL
ACTIONS
 We can perform several actions such as:
 Click, sendKeys, Select etc.
 We can not perform certain actions such as:
 Changing Value of a Hidden Field.
 Element must be present in the view to access.
VERFICATION
 We perform several assertions based on our
actions
 Did the right page load?
 Did we get the expected message?
 Was the item created?
 Was the state of a item changed?
 Was the item deleted?
 Can we search for the item?
 Are all the expected elements present on the page?
WEBDRIVER FOR PHP
 Requires third-party library
 Using Nearsoft library
 https://github.com/Nearsoft/PHP-SeleniumClient
 Located in folder
tests/system/webdriver/SeleniumClient
 Provides the "magic" for interacting with the
page
WEBDRIVER CLASS
 Provided by third party library for PHP
 PHP implementations based on Java
 Found in
tests/system/webdriver/SeleniumClient/WebDriv
er.php
WEBDRIVER KEY METHODS
 get($url) – loads URL
 findElement(By::<>) – returns a WebElement
 xPath, id, name, className, cssSelector, linkText,
partialLinkText, tagName
 findElements(By::<>)
 returns array of WebElements (can be zero)
 executeScript() – executes JavaScript
 for example, move mouse to location
WEB ELEMENTS KEY METHODS
 sendKeys(): types into element
 getText(): returns element text
 getTagName: returns tag name
 getAttribute: returns value of attribute
 clear(): clears text
 click(): clicks
 submit(): submits form
LOCATOR STRATEGIES
LOCATORS
 Good Locators are:
 Unique
 Descriptive
 Unlikely to change
 CSS and Xpaths are mostly used selectors in automation
testing, ex.
 Xpath Selector: //div[@id='example']//a
 Css Selector: css=div.example a
 Performance of them varies with different browsers, for
more details about CSS Vs Xpath please see here:
http://elementalselenium.com/tips/category/benchmarks
 ‘ID’ selectors is the fastest method, but for that we need to
have id attributes for all the test fields
XPATHS
 Most powerful option for finding elements
 Used in findElement(By::xPath(“XPATH of
Element”)) method of webdriver.
 Slower than CSS selectors on most of the
browsers but reliable, and easy to maintain.
PHPUNIT ASSERT STATMENTS
 Assertions are expression which verify testing
logic and make sure that application behaves in
expected way.
ex. assertTrue, assertFalse, assertEquals
SCALING SYSTEM TEST
 Use cloud-based testing services
 Parallelize tests to run multiple test classes at
once
 Using Selenium Grid to Parallelize Tests
SAUCE-LABS
SAUCE LABS
 Sauce On Demand is a cloud-based service that
allows you to run automated cross-browser
functional tests at high speeds in parallel, so you
don't need to maintain testing infrastructure.
 Sauce Support 65+browser and OS combination .
 Operating Systems like Windows, Linux, Mac ,
 Browsers like Internet Explorer, Chrome, Firefox,
Safari, Opera, IPhone, Ipad, Android
 All latest browsers versions are available.
INTEGRATING SAUCE WITH
JOOMLA SYSTEM TESTS
 Setup Sauce Library
 Get Sauce Connect
 Change desired capabilities according to Sauce
Configuration
 Change Host name and port No. for webdriver
connection
 Demo
THANKS!
 Email ID:puneet.0191@gmail.com
 Twitter: puneet_kala
 Skype: puneet.0191
INEVITABLE

Más contenido relacionado

La actualidad más candente

Basics of Selenium IDE,Core, Remote Control
Basics of Selenium IDE,Core, Remote ControlBasics of Selenium IDE,Core, Remote Control
Basics of Selenium IDE,Core, Remote Controlusha kannappan
 
Get Started With Selenium 3 and Selenium 3 Grid
Get Started With Selenium 3 and Selenium 3 GridGet Started With Selenium 3 and Selenium 3 Grid
Get Started With Selenium 3 and Selenium 3 GridDaniel Herken
 
Automated UI testing with Selenium
Automated UI testing with SeleniumAutomated UI testing with Selenium
Automated UI testing with SeleniumYuriy Gerasimov
 
#ATAGTR2021 Presentation - "Selenium 4 Observability – a 90 Min Hands on Lab"
#ATAGTR2021 Presentation - "Selenium 4 Observability – a 90 Min Hands on Lab"#ATAGTR2021 Presentation - "Selenium 4 Observability – a 90 Min Hands on Lab"
#ATAGTR2021 Presentation - "Selenium 4 Observability – a 90 Min Hands on Lab"Agile Testing Alliance
 
Selenium Ide Tutorial
Selenium Ide TutorialSelenium Ide Tutorial
Selenium Ide Tutorialmetapix
 
Selenium Presentation at Engineering Colleges
Selenium Presentation at Engineering CollegesSelenium Presentation at Engineering Colleges
Selenium Presentation at Engineering CollegesVijay Rangaiah
 
Selenium - Introduction
Selenium - IntroductionSelenium - Introduction
Selenium - IntroductionAmr E. Mohamed
 
Web Test Automation with Selenium
Web Test Automation with SeleniumWeb Test Automation with Selenium
Web Test Automation with Seleniumvivek_prahlad
 
Web application testing with Selenium
Web application testing with SeleniumWeb application testing with Selenium
Web application testing with SeleniumKerry Buckley
 
Selenium webdriver course content rakesh hansalia
Selenium webdriver course content rakesh hansaliaSelenium webdriver course content rakesh hansalia
Selenium webdriver course content rakesh hansaliaRakesh Hansalia
 
selenium training | selenium course | selenium video tutorial | selenium for ...
selenium training | selenium course | selenium video tutorial | selenium for ...selenium training | selenium course | selenium video tutorial | selenium for ...
selenium training | selenium course | selenium video tutorial | selenium for ...Nancy Thomas
 
Automated Web Testing With Selenium
Automated Web Testing With SeleniumAutomated Web Testing With Selenium
Automated Web Testing With SeleniumDeepak Mittal
 
How to Configure Selenium WebDriver (java)
How to Configure Selenium WebDriver (java)How to Configure Selenium WebDriver (java)
How to Configure Selenium WebDriver (java)Dasun Eranthika
 

La actualidad más candente (20)

Basics of Selenium IDE,Core, Remote Control
Basics of Selenium IDE,Core, Remote ControlBasics of Selenium IDE,Core, Remote Control
Basics of Selenium IDE,Core, Remote Control
 
Get Started With Selenium 3 and Selenium 3 Grid
Get Started With Selenium 3 and Selenium 3 GridGet Started With Selenium 3 and Selenium 3 Grid
Get Started With Selenium 3 and Selenium 3 Grid
 
Automated UI testing with Selenium
Automated UI testing with SeleniumAutomated UI testing with Selenium
Automated UI testing with Selenium
 
Selenium
SeleniumSelenium
Selenium
 
#ATAGTR2021 Presentation - "Selenium 4 Observability – a 90 Min Hands on Lab"
#ATAGTR2021 Presentation - "Selenium 4 Observability – a 90 Min Hands on Lab"#ATAGTR2021 Presentation - "Selenium 4 Observability – a 90 Min Hands on Lab"
#ATAGTR2021 Presentation - "Selenium 4 Observability – a 90 Min Hands on Lab"
 
Selenium Ide Tutorial
Selenium Ide TutorialSelenium Ide Tutorial
Selenium Ide Tutorial
 
Selenium
SeleniumSelenium
Selenium
 
Selenium Presentation at Engineering Colleges
Selenium Presentation at Engineering CollegesSelenium Presentation at Engineering Colleges
Selenium Presentation at Engineering Colleges
 
Selenium web driver
Selenium web driverSelenium web driver
Selenium web driver
 
Selenium - Introduction
Selenium - IntroductionSelenium - Introduction
Selenium - Introduction
 
Web Test Automation with Selenium
Web Test Automation with SeleniumWeb Test Automation with Selenium
Web Test Automation with Selenium
 
Web application testing with Selenium
Web application testing with SeleniumWeb application testing with Selenium
Web application testing with Selenium
 
Selenium with java
Selenium with javaSelenium with java
Selenium with java
 
Selenium web driver
Selenium web driverSelenium web driver
Selenium web driver
 
Selenium Webdriver
Selenium WebdriverSelenium Webdriver
Selenium Webdriver
 
Selenium webdriver course content rakesh hansalia
Selenium webdriver course content rakesh hansaliaSelenium webdriver course content rakesh hansalia
Selenium webdriver course content rakesh hansalia
 
selenium training | selenium course | selenium video tutorial | selenium for ...
selenium training | selenium course | selenium video tutorial | selenium for ...selenium training | selenium course | selenium video tutorial | selenium for ...
selenium training | selenium course | selenium video tutorial | selenium for ...
 
Automated Web Testing With Selenium
Automated Web Testing With SeleniumAutomated Web Testing With Selenium
Automated Web Testing With Selenium
 
How to Configure Selenium WebDriver (java)
How to Configure Selenium WebDriver (java)How to Configure Selenium WebDriver (java)
How to Configure Selenium WebDriver (java)
 
Selenium
SeleniumSelenium
Selenium
 

Destacado

The Three Levels of AP Automation
The Three Levels of AP AutomationThe Three Levels of AP Automation
The Three Levels of AP AutomationHelpSystems
 
Mobile test automation perfecto star east
Mobile test automation perfecto star eastMobile test automation perfecto star east
Mobile test automation perfecto star eastPerfecto Mobile
 
Tutorial master cam x3 for beginers
Tutorial master cam x3 for beginersTutorial master cam x3 for beginers
Tutorial master cam x3 for beginersBernardus Sentot
 
Introduction to automation ppt
Introduction to automation pptIntroduction to automation ppt
Introduction to automation pptHimani Harbola
 
automation slides,plc,scada,HMI
automation slides,plc,scada,HMIautomation slides,plc,scada,HMI
automation slides,plc,scada,HMIBOSCH
 
Ppt on automation
Ppt on automation Ppt on automation
Ppt on automation harshaa
 
Chapter 1 introduction to automation
Chapter 1   introduction  to automationChapter 1   introduction  to automation
Chapter 1 introduction to automationMohamad Sahiedan
 
Basics of Automation, PLC and SCADA
Basics of Automation, PLC and SCADABasics of Automation, PLC and SCADA
Basics of Automation, PLC and SCADAIndira Kundu
 

Destacado (10)

The Three Levels of AP Automation
The Three Levels of AP AutomationThe Three Levels of AP Automation
The Three Levels of AP Automation
 
Mobile test automation perfecto star east
Mobile test automation perfecto star eastMobile test automation perfecto star east
Mobile test automation perfecto star east
 
Tutorial master cam x3 for beginers
Tutorial master cam x3 for beginersTutorial master cam x3 for beginers
Tutorial master cam x3 for beginers
 
Chapter1
Chapter1Chapter1
Chapter1
 
Mastercam
MastercamMastercam
Mastercam
 
Introduction to automation ppt
Introduction to automation pptIntroduction to automation ppt
Introduction to automation ppt
 
automation slides,plc,scada,HMI
automation slides,plc,scada,HMIautomation slides,plc,scada,HMI
automation slides,plc,scada,HMI
 
Ppt on automation
Ppt on automation Ppt on automation
Ppt on automation
 
Chapter 1 introduction to automation
Chapter 1   introduction  to automationChapter 1   introduction  to automation
Chapter 1 introduction to automation
 
Basics of Automation, PLC and SCADA
Basics of Automation, PLC and SCADABasics of Automation, PLC and SCADA
Basics of Automation, PLC and SCADA
 

Similar a Selenium-Webdriver With PHPUnit Automation test for Joomla CMS!

Mastering Test Automation: How To Use Selenium Successfully
Mastering Test Automation: How To Use Selenium SuccessfullyMastering Test Automation: How To Use Selenium Successfully
Mastering Test Automation: How To Use Selenium SuccessfullySpringPeople
 
Selenium Automation Testing Interview Questions And Answers
Selenium Automation Testing Interview Questions And AnswersSelenium Automation Testing Interview Questions And Answers
Selenium Automation Testing Interview Questions And AnswersAjit Jadhav
 
Automated Web Testing With Selenium
Automated Web Testing With SeleniumAutomated Web Testing With Selenium
Automated Web Testing With SeleniumJodie Miners
 
Unit testing php-unit - phing - selenium_v2
Unit testing   php-unit - phing - selenium_v2Unit testing   php-unit - phing - selenium_v2
Unit testing php-unit - phing - selenium_v2Tricode (part of Dept)
 
Acceptance & Functional Testing with Codeception - SunshinePHP 2016
Acceptance & Functional Testing with Codeception - SunshinePHP 2016Acceptance & Functional Testing with Codeception - SunshinePHP 2016
Acceptance & Functional Testing with Codeception - SunshinePHP 2016Joe Ferguson
 
2013 10-10 selenium presentation to ocjug
2013 10-10 selenium presentation to ocjug2013 10-10 selenium presentation to ocjug
2013 10-10 selenium presentation to ocjugPhilip Schlesinger
 
Acceptance & Functional Testing with Codeception - Devspace 2015
Acceptance & Functional Testing with Codeception - Devspace 2015 Acceptance & Functional Testing with Codeception - Devspace 2015
Acceptance & Functional Testing with Codeception - Devspace 2015 Joe Ferguson
 
Selenium & PHPUnit made easy with Steward (Berlin, April 2017)
Selenium & PHPUnit made easy with Steward (Berlin, April 2017)Selenium & PHPUnit made easy with Steward (Berlin, April 2017)
Selenium & PHPUnit made easy with Steward (Berlin, April 2017)Ondřej Machulda
 
Automation - web testing with selenium
Automation - web testing with seleniumAutomation - web testing with selenium
Automation - web testing with seleniumTzirla Rozental
 
Testing Java Web Apps With Selenium
Testing Java Web Apps With SeleniumTesting Java Web Apps With Selenium
Testing Java Web Apps With SeleniumMarakana Inc.
 

Similar a Selenium-Webdriver With PHPUnit Automation test for Joomla CMS! (20)

Mastering Test Automation: How To Use Selenium Successfully
Mastering Test Automation: How To Use Selenium SuccessfullyMastering Test Automation: How To Use Selenium Successfully
Mastering Test Automation: How To Use Selenium Successfully
 
Codeception
CodeceptionCodeception
Codeception
 
Selenium Automation Testing Interview Questions And Answers
Selenium Automation Testing Interview Questions And AnswersSelenium Automation Testing Interview Questions And Answers
Selenium Automation Testing Interview Questions And Answers
 
Automated Web Testing With Selenium
Automated Web Testing With SeleniumAutomated Web Testing With Selenium
Automated Web Testing With Selenium
 
Unit testing php-unit - phing - selenium_v2
Unit testing   php-unit - phing - selenium_v2Unit testing   php-unit - phing - selenium_v2
Unit testing php-unit - phing - selenium_v2
 
Selenium
SeleniumSelenium
Selenium
 
Selenium.pptx
Selenium.pptxSelenium.pptx
Selenium.pptx
 
Testing In Java
Testing In JavaTesting In Java
Testing In Java
 
Testing In Java4278
Testing In Java4278Testing In Java4278
Testing In Java4278
 
Selenium
SeleniumSelenium
Selenium
 
Qa process
Qa processQa process
Qa process
 
Qa process
Qa processQa process
Qa process
 
Selenium
SeleniumSelenium
Selenium
 
Selenium
SeleniumSelenium
Selenium
 
Acceptance & Functional Testing with Codeception - SunshinePHP 2016
Acceptance & Functional Testing with Codeception - SunshinePHP 2016Acceptance & Functional Testing with Codeception - SunshinePHP 2016
Acceptance & Functional Testing with Codeception - SunshinePHP 2016
 
2013 10-10 selenium presentation to ocjug
2013 10-10 selenium presentation to ocjug2013 10-10 selenium presentation to ocjug
2013 10-10 selenium presentation to ocjug
 
Acceptance & Functional Testing with Codeception - Devspace 2015
Acceptance & Functional Testing with Codeception - Devspace 2015 Acceptance & Functional Testing with Codeception - Devspace 2015
Acceptance & Functional Testing with Codeception - Devspace 2015
 
Selenium & PHPUnit made easy with Steward (Berlin, April 2017)
Selenium & PHPUnit made easy with Steward (Berlin, April 2017)Selenium & PHPUnit made easy with Steward (Berlin, April 2017)
Selenium & PHPUnit made easy with Steward (Berlin, April 2017)
 
Automation - web testing with selenium
Automation - web testing with seleniumAutomation - web testing with selenium
Automation - web testing with selenium
 
Testing Java Web Apps With Selenium
Testing Java Web Apps With SeleniumTesting Java Web Apps With Selenium
Testing Java Web Apps With Selenium
 

Último

Application of GIS in Landslide Disaster Response.pptx
Application of GIS in Landslide Disaster Response.pptxApplication of GIS in Landslide Disaster Response.pptx
Application of GIS in Landslide Disaster Response.pptxRoquia Salam
 
Event 4 Introduction to Open Source.pptx
Event 4 Introduction to Open Source.pptxEvent 4 Introduction to Open Source.pptx
Event 4 Introduction to Open Source.pptxaryanv1753
 
INDIAN GCP GUIDELINE. for Regulatory affair 1st sem CRR
INDIAN GCP GUIDELINE. for Regulatory  affair 1st sem CRRINDIAN GCP GUIDELINE. for Regulatory  affair 1st sem CRR
INDIAN GCP GUIDELINE. for Regulatory affair 1st sem CRRsarwankumar4524
 
proposal kumeneger edited.docx A kumeeger
proposal kumeneger edited.docx A kumeegerproposal kumeneger edited.docx A kumeeger
proposal kumeneger edited.docx A kumeegerkumenegertelayegrama
 
RACHEL-ANN M. TENIBRO PRODUCT RESEARCH PRESENTATION
RACHEL-ANN M. TENIBRO PRODUCT RESEARCH PRESENTATIONRACHEL-ANN M. TENIBRO PRODUCT RESEARCH PRESENTATION
RACHEL-ANN M. TENIBRO PRODUCT RESEARCH PRESENTATIONRachelAnnTenibroAmaz
 
Dutch Power - 26 maart 2024 - Henk Kras - Circular Plastics
Dutch Power - 26 maart 2024 - Henk Kras - Circular PlasticsDutch Power - 26 maart 2024 - Henk Kras - Circular Plastics
Dutch Power - 26 maart 2024 - Henk Kras - Circular PlasticsDutch Power
 
SaaStr Workshop Wednesday w/ Kyle Norton, Owner.com
SaaStr Workshop Wednesday w/ Kyle Norton, Owner.comSaaStr Workshop Wednesday w/ Kyle Norton, Owner.com
SaaStr Workshop Wednesday w/ Kyle Norton, Owner.comsaastr
 
Engaging Eid Ul Fitr Presentation for Kindergartners.pptx
Engaging Eid Ul Fitr Presentation for Kindergartners.pptxEngaging Eid Ul Fitr Presentation for Kindergartners.pptx
Engaging Eid Ul Fitr Presentation for Kindergartners.pptxAsifArshad8
 
THE COUNTRY WHO SOLVED THE WORLD_HOW CHINA LAUNCHED THE CIVILIZATION REVOLUTI...
THE COUNTRY WHO SOLVED THE WORLD_HOW CHINA LAUNCHED THE CIVILIZATION REVOLUTI...THE COUNTRY WHO SOLVED THE WORLD_HOW CHINA LAUNCHED THE CIVILIZATION REVOLUTI...
THE COUNTRY WHO SOLVED THE WORLD_HOW CHINA LAUNCHED THE CIVILIZATION REVOLUTI...漢銘 謝
 
Chizaram's Women Tech Makers Deck. .pptx
Chizaram's Women Tech Makers Deck.  .pptxChizaram's Women Tech Makers Deck.  .pptx
Chizaram's Women Tech Makers Deck. .pptxogubuikealex
 
Call Girls In Aerocity 🤳 Call Us +919599264170
Call Girls In Aerocity 🤳 Call Us +919599264170Call Girls In Aerocity 🤳 Call Us +919599264170
Call Girls In Aerocity 🤳 Call Us +919599264170Escort Service
 
Internship Presentation | PPT | CSE | SE
Internship Presentation | PPT | CSE | SEInternship Presentation | PPT | CSE | SE
Internship Presentation | PPT | CSE | SESaleh Ibne Omar
 
Mathan flower ppt.pptx slide orchids ✨🌸
Mathan flower ppt.pptx slide orchids ✨🌸Mathan flower ppt.pptx slide orchids ✨🌸
Mathan flower ppt.pptx slide orchids ✨🌸mathanramanathan2005
 
CHROMATOGRAPHY and its types with procedure,diagrams,flow charts,advantages a...
CHROMATOGRAPHY and its types with procedure,diagrams,flow charts,advantages a...CHROMATOGRAPHY and its types with procedure,diagrams,flow charts,advantages a...
CHROMATOGRAPHY and its types with procedure,diagrams,flow charts,advantages a...university
 
Quality by design.. ppt for RA (1ST SEM
Quality by design.. ppt for  RA (1ST SEMQuality by design.. ppt for  RA (1ST SEM
Quality by design.. ppt for RA (1ST SEMCharmi13
 
PAG-UNLAD NG EKONOMIYA na dapat isaalang alang sa pag-aaral.
PAG-UNLAD NG EKONOMIYA na dapat isaalang alang sa pag-aaral.PAG-UNLAD NG EKONOMIYA na dapat isaalang alang sa pag-aaral.
PAG-UNLAD NG EKONOMIYA na dapat isaalang alang sa pag-aaral.KathleenAnnCordero2
 
DGT @ CTAC 2024 Valencia: Most crucial invest to digitalisation_Sven Zoelle_v...
DGT @ CTAC 2024 Valencia: Most crucial invest to digitalisation_Sven Zoelle_v...DGT @ CTAC 2024 Valencia: Most crucial invest to digitalisation_Sven Zoelle_v...
DGT @ CTAC 2024 Valencia: Most crucial invest to digitalisation_Sven Zoelle_v...Henrik Hanke
 
The Ten Facts About People With Autism Presentation
The Ten Facts About People With Autism PresentationThe Ten Facts About People With Autism Presentation
The Ten Facts About People With Autism PresentationNathan Young
 
Early Modern Spain. All about this period
Early Modern Spain. All about this periodEarly Modern Spain. All about this period
Early Modern Spain. All about this periodSaraIsabelJimenez
 

Último (19)

Application of GIS in Landslide Disaster Response.pptx
Application of GIS in Landslide Disaster Response.pptxApplication of GIS in Landslide Disaster Response.pptx
Application of GIS in Landslide Disaster Response.pptx
 
Event 4 Introduction to Open Source.pptx
Event 4 Introduction to Open Source.pptxEvent 4 Introduction to Open Source.pptx
Event 4 Introduction to Open Source.pptx
 
INDIAN GCP GUIDELINE. for Regulatory affair 1st sem CRR
INDIAN GCP GUIDELINE. for Regulatory  affair 1st sem CRRINDIAN GCP GUIDELINE. for Regulatory  affair 1st sem CRR
INDIAN GCP GUIDELINE. for Regulatory affair 1st sem CRR
 
proposal kumeneger edited.docx A kumeeger
proposal kumeneger edited.docx A kumeegerproposal kumeneger edited.docx A kumeeger
proposal kumeneger edited.docx A kumeeger
 
RACHEL-ANN M. TENIBRO PRODUCT RESEARCH PRESENTATION
RACHEL-ANN M. TENIBRO PRODUCT RESEARCH PRESENTATIONRACHEL-ANN M. TENIBRO PRODUCT RESEARCH PRESENTATION
RACHEL-ANN M. TENIBRO PRODUCT RESEARCH PRESENTATION
 
Dutch Power - 26 maart 2024 - Henk Kras - Circular Plastics
Dutch Power - 26 maart 2024 - Henk Kras - Circular PlasticsDutch Power - 26 maart 2024 - Henk Kras - Circular Plastics
Dutch Power - 26 maart 2024 - Henk Kras - Circular Plastics
 
SaaStr Workshop Wednesday w/ Kyle Norton, Owner.com
SaaStr Workshop Wednesday w/ Kyle Norton, Owner.comSaaStr Workshop Wednesday w/ Kyle Norton, Owner.com
SaaStr Workshop Wednesday w/ Kyle Norton, Owner.com
 
Engaging Eid Ul Fitr Presentation for Kindergartners.pptx
Engaging Eid Ul Fitr Presentation for Kindergartners.pptxEngaging Eid Ul Fitr Presentation for Kindergartners.pptx
Engaging Eid Ul Fitr Presentation for Kindergartners.pptx
 
THE COUNTRY WHO SOLVED THE WORLD_HOW CHINA LAUNCHED THE CIVILIZATION REVOLUTI...
THE COUNTRY WHO SOLVED THE WORLD_HOW CHINA LAUNCHED THE CIVILIZATION REVOLUTI...THE COUNTRY WHO SOLVED THE WORLD_HOW CHINA LAUNCHED THE CIVILIZATION REVOLUTI...
THE COUNTRY WHO SOLVED THE WORLD_HOW CHINA LAUNCHED THE CIVILIZATION REVOLUTI...
 
Chizaram's Women Tech Makers Deck. .pptx
Chizaram's Women Tech Makers Deck.  .pptxChizaram's Women Tech Makers Deck.  .pptx
Chizaram's Women Tech Makers Deck. .pptx
 
Call Girls In Aerocity 🤳 Call Us +919599264170
Call Girls In Aerocity 🤳 Call Us +919599264170Call Girls In Aerocity 🤳 Call Us +919599264170
Call Girls In Aerocity 🤳 Call Us +919599264170
 
Internship Presentation | PPT | CSE | SE
Internship Presentation | PPT | CSE | SEInternship Presentation | PPT | CSE | SE
Internship Presentation | PPT | CSE | SE
 
Mathan flower ppt.pptx slide orchids ✨🌸
Mathan flower ppt.pptx slide orchids ✨🌸Mathan flower ppt.pptx slide orchids ✨🌸
Mathan flower ppt.pptx slide orchids ✨🌸
 
CHROMATOGRAPHY and its types with procedure,diagrams,flow charts,advantages a...
CHROMATOGRAPHY and its types with procedure,diagrams,flow charts,advantages a...CHROMATOGRAPHY and its types with procedure,diagrams,flow charts,advantages a...
CHROMATOGRAPHY and its types with procedure,diagrams,flow charts,advantages a...
 
Quality by design.. ppt for RA (1ST SEM
Quality by design.. ppt for  RA (1ST SEMQuality by design.. ppt for  RA (1ST SEM
Quality by design.. ppt for RA (1ST SEM
 
PAG-UNLAD NG EKONOMIYA na dapat isaalang alang sa pag-aaral.
PAG-UNLAD NG EKONOMIYA na dapat isaalang alang sa pag-aaral.PAG-UNLAD NG EKONOMIYA na dapat isaalang alang sa pag-aaral.
PAG-UNLAD NG EKONOMIYA na dapat isaalang alang sa pag-aaral.
 
DGT @ CTAC 2024 Valencia: Most crucial invest to digitalisation_Sven Zoelle_v...
DGT @ CTAC 2024 Valencia: Most crucial invest to digitalisation_Sven Zoelle_v...DGT @ CTAC 2024 Valencia: Most crucial invest to digitalisation_Sven Zoelle_v...
DGT @ CTAC 2024 Valencia: Most crucial invest to digitalisation_Sven Zoelle_v...
 
The Ten Facts About People With Autism Presentation
The Ten Facts About People With Autism PresentationThe Ten Facts About People With Autism Presentation
The Ten Facts About People With Autism Presentation
 
Early Modern Spain. All about this period
Early Modern Spain. All about this periodEarly Modern Spain. All about this period
Early Modern Spain. All about this period
 

Selenium-Webdriver With PHPUnit Automation test for Joomla CMS!

  • 1. AUTOMATED SYSTEM TESTS FOR JOOMLA Puneet Kala
  • 2. OUTLINE  What is System Testing?  How is automation testing used in Joomla?  How do I set up my PC to run system tests?  How do I write system tests for my extension?
  • 3. SOME BASIC QUESTION  What is Automated testing?  Running programs to test other programs  What is PHPunit?  A library used for creating PHP unit tests  What is Selenium?  A program which is used for creating System Tests, Automating browsers  What is Xpath?  A syntax for navigating elements in a web page
  • 4. AUTOMATED TESTING IN JOOMLA  Webdriver Tests was started in Nov, 2012, by Mark Dexter  Backend CMS tests along with Selenium Webdriver were developed as part of GSOC,2013.  Frontend CMS Tests are being developed as part of GSOC, 2014.
  • 7. WHY DO WE NEED AUTOMATION TESTING  Helps in preventing software release with obvious bugs  Allows you to integrate continuous testing into your development process  Saves a lot of time  Reliable  Cost reduction
  • 9. SYSTEM TESTING  Test at the user level from outside the program  Testing a process for example: testing user creations, testing Tag creations  Running the application and testing it just like a user would do.
  • 10. SETUP TO RUN SYSTEM TESTS  PHPUnit 3.6 or higher (latest is 4.1) Use PHAR to install.  PHP 5.3.8 (required for Webdriver system tests)  Curl package (extension=php_curl.dll or php_curl.so in php.ini)
  • 11. SETUP TO RUN SYSTEM TESTS-2  Download Selenium Server (Java ".jar") from seleniumhq.com  run in background  Checkout Joomla from Github.com  Create configdef.php file (tests/system/servers)  used for old and new tests
  • 13. EXECUTE SYSTEM TESTS  Run Selenium Server in the background  do once and let it run  Change to desired folder  Webdriver System: tests/system/webdriver/tests  phpunit <optional name of sub-folder or file>
  • 14. TEST CONFIGURATION  phpunit.xml.dist / phpunit.xml  .dist is included in Git, .xml is local only  configdef.php.dist is generic  need to create configdef.php file with local values
  • 15. LETS LOOK AT A DEMO  Installation Tests  Tag Manager Tests
  • 16. SELENIUM WEBDRIVER VS SELENIUM IDE  IDE is a record and playback tool, which is not reliable as compared to Selenium Webdriver.  Selenium IDE tests require huge amount of Maintenance  Webdriver has a Object Oriented API  It is difficult to use Selenium IDE for checking complex test cases involving dynamic contents  No Programming logic (like loops, conditional statements) can be applied in Selenium IDE.
  • 17. ANATOMY OF WEBDRIVER TEST CLASS
  • 19. PAGE CLASSES  Classes that contains specific details about the Joomla page  $waitForXpath: identifies this page  $url: URL for the page  Elements: toolbar, input elements, menu elements  Methods specific to the page:  For example: TagManagerPage would contain functions like createTag(), editTag(), deleteTag(), searchTag()  Page classes do not perform any assertions, it is the job of test class to perform assertions.  Re-Usable/Maintainable code
  • 21. ACTIONS  We can perform several actions such as:  Click, sendKeys, Select etc.  We can not perform certain actions such as:  Changing Value of a Hidden Field.  Element must be present in the view to access.
  • 22. VERFICATION  We perform several assertions based on our actions  Did the right page load?  Did we get the expected message?  Was the item created?  Was the state of a item changed?  Was the item deleted?  Can we search for the item?  Are all the expected elements present on the page?
  • 23. WEBDRIVER FOR PHP  Requires third-party library  Using Nearsoft library  https://github.com/Nearsoft/PHP-SeleniumClient  Located in folder tests/system/webdriver/SeleniumClient  Provides the "magic" for interacting with the page
  • 24. WEBDRIVER CLASS  Provided by third party library for PHP  PHP implementations based on Java  Found in tests/system/webdriver/SeleniumClient/WebDriv er.php
  • 25. WEBDRIVER KEY METHODS  get($url) – loads URL  findElement(By::<>) – returns a WebElement  xPath, id, name, className, cssSelector, linkText, partialLinkText, tagName  findElements(By::<>)  returns array of WebElements (can be zero)  executeScript() – executes JavaScript  for example, move mouse to location
  • 26. WEB ELEMENTS KEY METHODS  sendKeys(): types into element  getText(): returns element text  getTagName: returns tag name  getAttribute: returns value of attribute  clear(): clears text  click(): clicks  submit(): submits form
  • 28. LOCATORS  Good Locators are:  Unique  Descriptive  Unlikely to change  CSS and Xpaths are mostly used selectors in automation testing, ex.  Xpath Selector: //div[@id='example']//a  Css Selector: css=div.example a  Performance of them varies with different browsers, for more details about CSS Vs Xpath please see here: http://elementalselenium.com/tips/category/benchmarks  ‘ID’ selectors is the fastest method, but for that we need to have id attributes for all the test fields
  • 29. XPATHS  Most powerful option for finding elements  Used in findElement(By::xPath(“XPATH of Element”)) method of webdriver.  Slower than CSS selectors on most of the browsers but reliable, and easy to maintain.
  • 30. PHPUNIT ASSERT STATMENTS  Assertions are expression which verify testing logic and make sure that application behaves in expected way. ex. assertTrue, assertFalse, assertEquals
  • 31. SCALING SYSTEM TEST  Use cloud-based testing services  Parallelize tests to run multiple test classes at once  Using Selenium Grid to Parallelize Tests
  • 33. SAUCE LABS  Sauce On Demand is a cloud-based service that allows you to run automated cross-browser functional tests at high speeds in parallel, so you don't need to maintain testing infrastructure.  Sauce Support 65+browser and OS combination .  Operating Systems like Windows, Linux, Mac ,  Browsers like Internet Explorer, Chrome, Firefox, Safari, Opera, IPhone, Ipad, Android  All latest browsers versions are available.
  • 34. INTEGRATING SAUCE WITH JOOMLA SYSTEM TESTS  Setup Sauce Library  Get Sauce Connect  Change desired capabilities according to Sauce Configuration  Change Host name and port No. for webdriver connection  Demo
  • 35. THANKS!  Email ID:puneet.0191@gmail.com  Twitter: puneet_kala  Skype: puneet.0191

Notas del editor

  1. You release a new version and someone finds a really obvious bug (most likely due to a stupid, last-minute coding error).
  2. Stop releasing new versions?? More Testing before each release Continuous testing during development Test daily after each change to the code base
  3. Parent class for all test classes Extends PHPUnit_Framework_TestCase (PHPUnitEclass) Uses bootstrap.php to autoload, configdef.php to get SeleniumConfig class Holds methods needed by all test classes doAdminLogin(), doAdminLogout()
  4. Problem: For an application that is under continuous development, web pages can change any time New Elements introduced Change in links, change in buttons Changes in the way the page looks Any change in the application should require changes in the page classes not in the actual test Logic for interacting with the application is written in Test Class but functions to perform that logic are present in the Page Classes
  5. Good Locators are: Unique Descriptive Unlikely to change CSS and Xpaths are mostly used selectors in automation testing, ex. Xpath Selector: //div[@id=&amp;apos;example&amp;apos;]//a Css Selector: css=div.example a Performance of them varies with different browsers, for more details about CSS Vs Xpath please see here: http://elementalselenium.com/tips/category/benchmarks ‘ID’ selectors is the fastest method, but for that we need to have id attributes for all the test fields