SlideShare uma empresa Scribd logo
1 de 43
Automated Web UI
     Testing
    Mikalai Alimenkou
  http://xpinjection.com
       @xpinjection
Do you need UI testing?
Ugly design = bad
user experience
Some sites can lose money
Think about design as
non-functional requirement
May be just do it manually?



Large number       Many
   of pages      browsers
Not all layout bugs are so visible
Navigation through all pages is very useful for all types of testing

NAVIGATION TESTS WITH
WEBDRIVER
Why WebDriver?
•   Works with many browsers
•   Can handle window size and browser settings
•   Clear and simple API
•   Allow to execute JavaScript
How do navigation tests work?
 Preconfigured                  Define all
 environment                   pages from
                              requirements




   Reference
                                      Wait for
   database      Load in series
                                    READY state
Types of UI testing


           Image
          analysis

     Screenshot based




     Static (HTML, CSS,
         JavaScript)
Well structured page has better chances to be displayed correctly

STATIC ANALYSIS TECHNIQUES
How to access page?
•   Filter in Java for static HTML
•   Lightweight proxy server
•   HtmlWebDriver
•   Real browsers to make things realistic:
     • work with user agents
     • browser specific headers
     • dynamic pages
Existing solutions for Java
• http://www.rexsl.com/rexsl-w3c/ - API for
  W3C validators
• https://code.google.com/p/w3c-markup-
  validation-filter/ - validation Filter
DEMO TIME!
DEMO TIME!
Useful techniques


• Disable everything you don’t want to validate
• Disable ads, banners, images to make
everything quicker
• Static CSS may be validated on server
HTTP proxy for statistics




  https://github.com/webmetrics/browsermob-proxy
What can you get from
                       HTTP proxy?
• External resources integration status
  (Facebook, Twitter, Ads, etc.)
• Images, banners, ads and other nonfunctional
  resources
• Collect HTTP traffic for analysis (404, redirects,
  loading time, etc.)
Net panel in Firebug
Export statistics and reports




http://www.softwareishard.com/blog/firebug/automate-page-
load-performance-testing-with-firebug-and-selenium/
DEMO TIME!
Compare page screenshots with history to limit amount of manual work

SCREENSHOT BASED TECHNIQUES
Regression screenshots
              For each
           navigation test



                             Compare

             Take fresh
            screenshots
How can it be stable?

• Disable or mock banners, GIFs and other
  animation
• Limit tested regions for each page
• Improve screenshot comparison algorithms
• Use image comparison tools for manual
  validation
Find panels by corners
                          Check
                         X and Y




                         Validate
                         content
Extract information about page elements for extended layout analysis

SCREENSHOT PROCESSING
TECHNIQUES
Fighting Layout Bugs

• http://code.google.com/p/fighting-layout-
  bugs/
• Open source Java library
• Uses WebDriver
• Proof of concepts
Need to detect edges and text
                 Edges




       Edges              Text
Simple text detector

•   Inject jQuery to the page for simple JavaScript
•   jQuery('*').css('color', '#000000');
•   Take screenshot
•   jQuery('*').css('color', '#FFFFFF');
•   Take screenshot again
•   Compare screenshots – different pixels are
    text
Simple edge detector

• Inject jQuery to the page for simple JavaScript
• jQuery('*').css('color', 'transparent');
• Take screenshot
• Analyze pixel sequences with the same or very
  similar color and contrast pixels from left or
  right
• Apply minimal length constraints
#1. Text overlapping edges

• Bug is where text
  intersects edge
• Replace each buggy
  pixel with circle to
  define buggy areas
• Blend detected areas
  with red line on the
  screenshot
#2. Text with low contrast

• Bug is where text color is close to background
color
• Find areas with the same background color
• Blend detected areas with red line on the
screenshot
#3. Invalid images detection

• Missed, empty or invalid URL
• 4xx or 5xx HTTP response code
• Content-type is not image related
#4. Focus visibility detection

• Switch to the next element with TAB
• Take screenshot
• Check if something changed for element
Other types of layout bugs

• Different layouts in different browsers
• Unintended scrollbars for dialogs and frames
• Broken panel borders
• Text partly hidden
• Broken elements flow
We are capable to do more
with modern technologies
      and our brain
@xpinjection
             http://xpinjection.com
mikalai.alimenkou@xpinjection.com

Mais conteúdo relacionado

Mais procurados

Automation testing strategy, approach & planning
Automation testing  strategy, approach & planningAutomation testing  strategy, approach & planning
Automation testing strategy, approach & planning
SivaprasanthRentala1975
 
automation testing benefits
automation testing benefitsautomation testing benefits
automation testing benefits
nazeer pasha
 

Mais procurados (20)

Test Automation - Principles and Practices
Test Automation - Principles and PracticesTest Automation - Principles and Practices
Test Automation - Principles and Practices
 
Automation Testing
Automation TestingAutomation Testing
Automation Testing
 
Automation testing
Automation testingAutomation testing
Automation testing
 
Manual Vs Automation Testing
Manual Vs Automation TestingManual Vs Automation Testing
Manual Vs Automation Testing
 
Postman.ppt
Postman.pptPostman.ppt
Postman.ppt
 
BDD with Cucumber
BDD with CucumberBDD with Cucumber
BDD with Cucumber
 
Automated vs manual testing
Automated vs manual testingAutomated vs manual testing
Automated vs manual testing
 
Automation testing strategy, approach & planning
Automation testing  strategy, approach & planningAutomation testing  strategy, approach & planning
Automation testing strategy, approach & planning
 
Test Automation
Test AutomationTest Automation
Test Automation
 
Test automation proposal
Test automation proposalTest automation proposal
Test automation proposal
 
Introduction to selenium
Introduction to seleniumIntroduction to selenium
Introduction to selenium
 
test_automation_POC
test_automation_POCtest_automation_POC
test_automation_POC
 
Test Automation Framework Design | www.idexcel.com
Test Automation Framework Design | www.idexcel.comTest Automation Framework Design | www.idexcel.com
Test Automation Framework Design | www.idexcel.com
 
How To Write A Test Case In Software Testing | Edureka
How To Write A Test Case In Software Testing | EdurekaHow To Write A Test Case In Software Testing | Edureka
How To Write A Test Case In Software Testing | Edureka
 
Test Automation Framework with BDD and Cucumber
Test Automation Framework with BDD and CucumberTest Automation Framework with BDD and Cucumber
Test Automation Framework with BDD and Cucumber
 
Selenium with Cucumber
Selenium  with Cucumber Selenium  with Cucumber
Selenium with Cucumber
 
Web automation using selenium.ppt
Web automation using selenium.pptWeb automation using selenium.ppt
Web automation using selenium.ppt
 
Automation Testing using Selenium
Automation Testing using SeleniumAutomation Testing using Selenium
Automation Testing using Selenium
 
automation testing benefits
automation testing benefitsautomation testing benefits
automation testing benefits
 
Building a Test Automation Strategy for Success
Building a Test Automation Strategy for SuccessBuilding a Test Automation Strategy for Success
Building a Test Automation Strategy for Success
 

Destaque

Советы для успешной автоматизации тестирования веб-приложений
Советы для успешной автоматизации тестирования веб-приложенийСоветы для успешной автоматизации тестирования веб-приложений
Советы для успешной автоматизации тестирования веб-приложений
Mairbek Khadikov
 
Бытовая классификация тестировщиков с точки зрения разработчика
Бытовая классификация тестировщиков с точки зрения разработчикаБытовая классификация тестировщиков с точки зрения разработчика
Бытовая классификация тестировщиков с точки зрения разработчика
Mikalai Alimenkou
 
Инструменты для тестирования пользовательского интерфейса UI
Инструменты для тестирования пользовательского интерфейса UIИнструменты для тестирования пользовательского интерфейса UI
Инструменты для тестирования пользовательского интерфейса UI
Olesia Velychko
 
Full Scale Automation Using Selenium
Full Scale Automation Using SeleniumFull Scale Automation Using Selenium
Full Scale Automation Using Selenium
Andrii Dzynia
 
Автоматизация тестирования. Разбор конкретного примера - продукта XML2Selenium
Автоматизация тестирования. Разбор конкретного примера - продукта XML2SeleniumАвтоматизация тестирования. Разбор конкретного примера - продукта XML2Selenium
Автоматизация тестирования. Разбор конкретного примера - продукта XML2Selenium
jazzteam
 
Инструменты для тестирования UI
Инструменты для тестирования UIИнструменты для тестирования UI
Инструменты для тестирования UI
ISsoft
 

Destaque (20)

Great functional testing with WebDriver and Thucydides
Great functional testing with WebDriver and ThucydidesGreat functional testing with WebDriver and Thucydides
Great functional testing with WebDriver and Thucydides
 
Советы для успешной автоматизации тестирования веб-приложений
Советы для успешной автоматизации тестирования веб-приложенийСоветы для успешной автоматизации тестирования веб-приложений
Советы для успешной автоматизации тестирования веб-приложений
 
User Interface Тестирование – все ли так просто?
User Interface Тестирование – все ли так просто?User Interface Тестирование – все ли так просто?
User Interface Тестирование – все ли так просто?
 
Бытовая классификация тестировщиков с точки зрения разработчика
Бытовая классификация тестировщиков с точки зрения разработчикаБытовая классификация тестировщиков с точки зрения разработчика
Бытовая классификация тестировщиков с точки зрения разработчика
 
Why testing take so long
Why testing take so longWhy testing take so long
Why testing take so long
 
Плюсы и минусы автоматизации, пример из жизни
Плюсы и минусы автоматизации, пример из жизниПлюсы и минусы автоматизации, пример из жизни
Плюсы и минусы автоматизации, пример из жизни
 
Инструменты для тестирования пользовательского интерфейса UI
Инструменты для тестирования пользовательского интерфейса UIИнструменты для тестирования пользовательского интерфейса UI
Инструменты для тестирования пользовательского интерфейса UI
 
Full Scale Automation Using Selenium
Full Scale Automation Using SeleniumFull Scale Automation Using Selenium
Full Scale Automation Using Selenium
 
Selenide –  лаконичные тесты на Selenium 2 WebDriver + Java bindings
Selenide –  лаконичные тесты на Selenium 2 WebDriver + Java bindingsSelenide –  лаконичные тесты на Selenium 2 WebDriver + Java bindings
Selenide –  лаконичные тесты на Selenium 2 WebDriver + Java bindings
 
Автотесты на уровне API для Java-приложений
Автотесты на уровне API для Java-приложенийАвтотесты на уровне API для Java-приложений
Автотесты на уровне API для Java-приложений
 
QA Fes 2016. Роман Якимчук. Продвинутое тестирование состояний и переходов
QA Fes 2016. Роман Якимчук. Продвинутое тестирование состояний и переходовQA Fes 2016. Роман Якимчук. Продвинутое тестирование состояний и переходов
QA Fes 2016. Роман Якимчук. Продвинутое тестирование состояний и переходов
 
Будни тестирования Cassandr-ы
Будни тестирования Cassandr-ыБудни тестирования Cassandr-ы
Будни тестирования Cassandr-ы
 
Automated UI testing done right (DDDSydney)
Automated UI testing done right (DDDSydney)Automated UI testing done right (DDDSydney)
Automated UI testing done right (DDDSydney)
 
Автоматизация тестирования. Разбор конкретного примера - продукта XML2Selenium
Автоматизация тестирования. Разбор конкретного примера - продукта XML2SeleniumАвтоматизация тестирования. Разбор конкретного примера - продукта XML2Selenium
Автоматизация тестирования. Разбор конкретного примера - продукта XML2Selenium
 
Простой взгляд на автоматизацию или Как не изобретать велосипед
Простой взгляд на автоматизацию или Как не изобретать велосипедПростой взгляд на автоматизацию или Как не изобретать велосипед
Простой взгляд на автоматизацию или Как не изобретать велосипед
 
Инструменты для тестирования UI
Инструменты для тестирования UIИнструменты для тестирования UI
Инструменты для тестирования UI
 
Мини-школа тестировщиков, ориентированных на Web
Мини-школа тестировщиков, ориентированных на WebМини-школа тестировщиков, ориентированных на Web
Мини-школа тестировщиков, ориентированных на Web
 
От ручного тестирования к автоматическому: опыт внедрения в крупном проекте
От ручного тестирования к автоматическому: опыт внедрения в крупном проектеОт ручного тестирования к автоматическому: опыт внедрения в крупном проекте
От ручного тестирования к автоматическому: опыт внедрения в крупном проекте
 
Оптимизация процесса тестирования локализаций
Оптимизация процесса тестирования локализацийОптимизация процесса тестирования локализаций
Оптимизация процесса тестирования локализаций
 
Как эффективно организовать Автоматизацию, если у вас недостаточно времени, р...
Как эффективно организовать Автоматизацию, если у вас недостаточно времени, р...Как эффективно организовать Автоматизацию, если у вас недостаточно времени, р...
Как эффективно организовать Автоматизацию, если у вас недостаточно времени, р...
 

Semelhante a Automated UI Testing

Talk Paris Infovis 091207132953 Phpapp01(2)
Talk Paris Infovis 091207132953 Phpapp01(2)Talk Paris Infovis 091207132953 Phpapp01(2)
Talk Paris Infovis 091207132953 Phpapp01(2)
johnnybiz
 

Semelhante a Automated UI Testing (20)

Sai Sharan_UI_Resume
Sai Sharan_UI_ResumeSai Sharan_UI_Resume
Sai Sharan_UI_Resume
 
Santosh_Resume_Java
Santosh_Resume_JavaSantosh_Resume_Java
Santosh_Resume_Java
 
Selenium – Web Browser Automation
Selenium – Web Browser AutomationSelenium – Web Browser Automation
Selenium – Web Browser Automation
 
Untying the Knots of Web Dev with Internet Explorer
Untying the Knots of Web Dev with Internet Explorer Untying the Knots of Web Dev with Internet Explorer
Untying the Knots of Web Dev with Internet Explorer
 
Acceptance Test-driven Development with Cucumber-jvm
Acceptance Test-driven Development with Cucumber-jvmAcceptance Test-driven Development with Cucumber-jvm
Acceptance Test-driven Development with Cucumber-jvm
 
SenchaCon 2016: The Changing Landscape of JavaScript Testing - Joel Watson an...
SenchaCon 2016: The Changing Landscape of JavaScript Testing - Joel Watson an...SenchaCon 2016: The Changing Landscape of JavaScript Testing - Joel Watson an...
SenchaCon 2016: The Changing Landscape of JavaScript Testing - Joel Watson an...
 
Developing JavaScript Widgets
Developing JavaScript WidgetsDeveloping JavaScript Widgets
Developing JavaScript Widgets
 
Prashant_Shukla-UI
Prashant_Shukla-UIPrashant_Shukla-UI
Prashant_Shukla-UI
 
A guide to hiring a great developer to build your first app (redacted version)
A guide to hiring a great developer to build your first app (redacted version)A guide to hiring a great developer to build your first app (redacted version)
A guide to hiring a great developer to build your first app (redacted version)
 
Accessibility Testing - Using Asqatasun - Meetup Webinar
Accessibility Testing - Using Asqatasun - Meetup WebinarAccessibility Testing - Using Asqatasun - Meetup Webinar
Accessibility Testing - Using Asqatasun - Meetup Webinar
 
Colorful world-of-visual-automation-testing-latest
Colorful world-of-visual-automation-testing-latestColorful world-of-visual-automation-testing-latest
Colorful world-of-visual-automation-testing-latest
 
Talk Paris Infovis 091207132953 Phpapp01(2)
Talk Paris Infovis 091207132953 Phpapp01(2)Talk Paris Infovis 091207132953 Phpapp01(2)
Talk Paris Infovis 091207132953 Phpapp01(2)
 
Using Web Standards to create Interactive Data Visualizations for the Web
Using Web Standards to create Interactive Data Visualizations for the WebUsing Web Standards to create Interactive Data Visualizations for the Web
Using Web Standards to create Interactive Data Visualizations for the Web
 
[2015/2016] HTML5 and CSS3 Refresher
[2015/2016] HTML5 and CSS3 Refresher[2015/2016] HTML5 and CSS3 Refresher
[2015/2016] HTML5 and CSS3 Refresher
 
orcreatehappyusers
orcreatehappyusersorcreatehappyusers
orcreatehappyusers
 
orcreatehappyusers
orcreatehappyusersorcreatehappyusers
orcreatehappyusers
 
Building SPA’s (Single Page App) with Backbone.js
Building SPA’s (Single Page App) with Backbone.jsBuilding SPA’s (Single Page App) with Backbone.js
Building SPA’s (Single Page App) with Backbone.js
 
JavaScript in Universal Windows Platform apps
JavaScript in Universal Windows Platform appsJavaScript in Universal Windows Platform apps
JavaScript in Universal Windows Platform apps
 
Web Automation Testing for developers?
Web Automation Testing for developers?Web Automation Testing for developers?
Web Automation Testing for developers?
 
KATHY ZHANG_3
KATHY ZHANG_3KATHY ZHANG_3
KATHY ZHANG_3
 

Mais de Mikalai Alimenkou

Бытовая классификация тестировщиков с точки зрения разработчика
Бытовая классификация тестировщиков с точки зрения разработчикаБытовая классификация тестировщиков с точки зрения разработчика
Бытовая классификация тестировщиков с точки зрения разработчика
Mikalai Alimenkou
 

Mais de Mikalai Alimenkou (20)

Rise and fall of Story Points. Capacity based planning from the trenches.
Rise and fall of Story Points. Capacity based planning from the trenches.Rise and fall of Story Points. Capacity based planning from the trenches.
Rise and fall of Story Points. Capacity based planning from the trenches.
 
Static analysis tools as the best friend of QA
Static analysis tools as the best friend of QAStatic analysis tools as the best friend of QA
Static analysis tools as the best friend of QA
 
Modern CI/CD in the microservices world with Kubernetes
Modern CI/CD in the microservices world with KubernetesModern CI/CD in the microservices world with Kubernetes
Modern CI/CD in the microservices world with Kubernetes
 
Saga about distributed business transactions in microservices world
Saga about distributed business transactions in microservices worldSaga about distributed business transactions in microservices world
Saga about distributed business transactions in microservices world
 
Effectiveness tips from Kubernetes trenches by Captain Obvious
Effectiveness tips from Kubernetes trenches by Captain ObviousEffectiveness tips from Kubernetes trenches by Captain Obvious
Effectiveness tips from Kubernetes trenches by Captain Obvious
 
Ride the database in JUnit tests with Database Rider
Ride the database in JUnit tests with Database RiderRide the database in JUnit tests with Database Rider
Ride the database in JUnit tests with Database Rider
 
Wastful waste or why everything is so slow in development
Wastful waste or why everything is so slow in developmentWastful waste or why everything is so slow in development
Wastful waste or why everything is so slow in development
 
Hexagonal architecture with Spring Boot
Hexagonal architecture with Spring BootHexagonal architecture with Spring Boot
Hexagonal architecture with Spring Boot
 
Wastful waste or why everything is so slow in development
Wastful waste or why everything is so slow in developmentWastful waste or why everything is so slow in development
Wastful waste or why everything is so slow in development
 
DevOps checklist or how to understand where is your team in DevOps landscape ...
DevOps checklist or how to understand where is your team in DevOps landscape ...DevOps checklist or how to understand where is your team in DevOps landscape ...
DevOps checklist or how to understand where is your team in DevOps landscape ...
 
DevOps checklist or how to understand where is your team in DevOps landscape
DevOps checklist or how to understand where is your team in DevOps landscapeDevOps checklist or how to understand where is your team in DevOps landscape
DevOps checklist or how to understand where is your team in DevOps landscape
 
Практические трудности в разработке Медкарты для целой страны
Практические трудности в разработке Медкарты для целой страныПрактические трудности в разработке Медкарты для целой страны
Практические трудности в разработке Медкарты для целой страны
 
Hexagonal architecture with Spring Boot [EPAM Java online conference]
Hexagonal architecture with Spring Boot [EPAM Java online conference]Hexagonal architecture with Spring Boot [EPAM Java online conference]
Hexagonal architecture with Spring Boot [EPAM Java online conference]
 
Bro, manage test data like a pro! [QA Fest 2018]
Bro, manage test data like a pro! [QA Fest 2018]Bro, manage test data like a pro! [QA Fest 2018]
Bro, manage test data like a pro! [QA Fest 2018]
 
Agile antipatterns: review after 10 years of practice
Agile antipatterns: review after 10 years of practiceAgile antipatterns: review after 10 years of practice
Agile antipatterns: review after 10 years of practice
 
Hexagonal architecture with Spring Boot
Hexagonal architecture with Spring BootHexagonal architecture with Spring Boot
Hexagonal architecture with Spring Boot
 
Bro, manage test data like a pro!
Bro, manage test data like a pro!Bro, manage test data like a pro!
Bro, manage test data like a pro!
 
Бытовая классификация тестировщиков с точки зрения разработчика
Бытовая классификация тестировщиков с точки зрения разработчикаБытовая классификация тестировщиков с точки зрения разработчика
Бытовая классификация тестировщиков с точки зрения разработчика
 
Code Review tool for personal effectiveness and waste analysis
Code Review tool for personal effectiveness and waste analysisCode Review tool for personal effectiveness and waste analysis
Code Review tool for personal effectiveness and waste analysis
 
Funny stories and anti-patterns from DevOps landscape
Funny stories and anti-patterns from DevOps landscapeFunny stories and anti-patterns from DevOps landscape
Funny stories and anti-patterns from DevOps landscape
 

Último

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Último (20)

Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 

Automated UI Testing

  • 1. Automated Web UI Testing Mikalai Alimenkou http://xpinjection.com @xpinjection
  • 2.
  • 3. Do you need UI testing?
  • 4. Ugly design = bad user experience
  • 5. Some sites can lose money
  • 6. Think about design as non-functional requirement
  • 7. May be just do it manually? Large number Many of pages browsers
  • 8. Not all layout bugs are so visible
  • 9. Navigation through all pages is very useful for all types of testing NAVIGATION TESTS WITH WEBDRIVER
  • 10. Why WebDriver? • Works with many browsers • Can handle window size and browser settings • Clear and simple API • Allow to execute JavaScript
  • 11. How do navigation tests work? Preconfigured Define all environment pages from requirements Reference Wait for database Load in series READY state
  • 12. Types of UI testing Image analysis Screenshot based Static (HTML, CSS, JavaScript)
  • 13. Well structured page has better chances to be displayed correctly STATIC ANALYSIS TECHNIQUES
  • 14.
  • 15.
  • 16. How to access page? • Filter in Java for static HTML • Lightweight proxy server • HtmlWebDriver • Real browsers to make things realistic: • work with user agents • browser specific headers • dynamic pages
  • 17. Existing solutions for Java • http://www.rexsl.com/rexsl-w3c/ - API for W3C validators • https://code.google.com/p/w3c-markup- validation-filter/ - validation Filter
  • 19.
  • 20.
  • 22. Useful techniques • Disable everything you don’t want to validate • Disable ads, banners, images to make everything quicker • Static CSS may be validated on server
  • 23. HTTP proxy for statistics https://github.com/webmetrics/browsermob-proxy
  • 24. What can you get from HTTP proxy? • External resources integration status (Facebook, Twitter, Ads, etc.) • Images, banners, ads and other nonfunctional resources • Collect HTTP traffic for analysis (404, redirects, loading time, etc.)
  • 25. Net panel in Firebug
  • 26. Export statistics and reports http://www.softwareishard.com/blog/firebug/automate-page- load-performance-testing-with-firebug-and-selenium/
  • 28. Compare page screenshots with history to limit amount of manual work SCREENSHOT BASED TECHNIQUES
  • 29. Regression screenshots For each navigation test Compare Take fresh screenshots
  • 30. How can it be stable? • Disable or mock banners, GIFs and other animation • Limit tested regions for each page • Improve screenshot comparison algorithms • Use image comparison tools for manual validation
  • 31. Find panels by corners Check X and Y Validate content
  • 32. Extract information about page elements for extended layout analysis SCREENSHOT PROCESSING TECHNIQUES
  • 33. Fighting Layout Bugs • http://code.google.com/p/fighting-layout- bugs/ • Open source Java library • Uses WebDriver • Proof of concepts
  • 34. Need to detect edges and text Edges Edges Text
  • 35. Simple text detector • Inject jQuery to the page for simple JavaScript • jQuery('*').css('color', '#000000'); • Take screenshot • jQuery('*').css('color', '#FFFFFF'); • Take screenshot again • Compare screenshots – different pixels are text
  • 36. Simple edge detector • Inject jQuery to the page for simple JavaScript • jQuery('*').css('color', 'transparent'); • Take screenshot • Analyze pixel sequences with the same or very similar color and contrast pixels from left or right • Apply minimal length constraints
  • 37. #1. Text overlapping edges • Bug is where text intersects edge • Replace each buggy pixel with circle to define buggy areas • Blend detected areas with red line on the screenshot
  • 38. #2. Text with low contrast • Bug is where text color is close to background color • Find areas with the same background color • Blend detected areas with red line on the screenshot
  • 39. #3. Invalid images detection • Missed, empty or invalid URL • 4xx or 5xx HTTP response code • Content-type is not image related
  • 40. #4. Focus visibility detection • Switch to the next element with TAB • Take screenshot • Check if something changed for element
  • 41. Other types of layout bugs • Different layouts in different browsers • Unintended scrollbars for dialogs and frames • Broken panel borders • Text partly hidden • Broken elements flow
  • 42. We are capable to do more with modern technologies and our brain
  • 43. @xpinjection http://xpinjection.com mikalai.alimenkou@xpinjection.com