SlideShare a Scribd company logo
Web Forms and
automated tests
Michali Konstantinidis
All content by the author unless mentioned otherwise
The problems
●No control over Page, Web and User Control
creation
●Not isolating view from code-behind
○Access web form elements directly in code
●Dependency on ambient statics (Request,
Response, Session, ViewState…)
●Automated tests next to impossible
Some automated tests are still
feasible
●Test end-to-end, from UI to database.
●No quick feedback, expensive to write
●Create/Update/Delete tests: Time-
consuming database setup/teardowns
●Preconditions: Possible a large chain of test
data with relationships
I’m not saying not to have end-to-
end tests
A test harness just needs
to look a bit like this...
Manual tests
UI/Acceptance tests
Integration tests
Unit tests
Model-View-Presenter
●Derivative of the MVC
●The “view” (Web Forms Page) marshalls
user requests, not the presenter
●Usually a 1-to-1 relationship exists between
a view and a presenter
Web Forms with MVP
Key Points
●Presenter contains UI logic, and delegates to
business layer
●View marshalls requests and makes Web
Forms components available to the
Presenter
●The Presenter does not operate on concrete
implementations, only on interfaces!
Test Isolation
●Framework components accessible by
statics can be wrapped or accessed via
abstract classes, if available, and mocked
○Session - HttpSessionStateBase
○HttpContext - HttpContextWrapper
○Or make those available via a Page subclass
●Leave View with barely existing logic,
making it not worth testing
And, that’s (almost) it
●Circular reference between View and
Presenter. “Newing-up” of objects should be
done in one place, in a factory.
●Dependency Injection in Web Forms?
○Unity.WebForms - by S. Kyle Korndoerfer

More Related Content

What's hot

Amruth-Testing
Amruth-TestingAmruth-Testing
Amruth-Testing
amruthraj m
 
Depurando VBScript no InduSoft Web Studio
Depurando VBScript no InduSoft Web StudioDepurando VBScript no InduSoft Web Studio
Depurando VBScript no InduSoft Web Studio
AVEVA
 
HDC 2010 - Creating Quality Software: A Look at Visual Studio 2010 Testing Tools
HDC 2010 - Creating Quality Software: A Look at Visual Studio 2010 Testing ToolsHDC 2010 - Creating Quality Software: A Look at Visual Studio 2010 Testing Tools
HDC 2010 - Creating Quality Software: A Look at Visual Studio 2010 Testing Tools
Jeff Bramwell
 
Testing of Microservices in a Cloud Environment
Testing of Microservices in a Cloud EnvironmentTesting of Microservices in a Cloud Environment
Testing of Microservices in a Cloud Environment
Amit Rawat
 
Grading the Quality of Selenium Tests
Grading the Quality of Selenium TestsGrading the Quality of Selenium Tests
Grading the Quality of Selenium Tests
Marcus Merrell
 
Design Patterns for Smart Applications
Design Patterns for Smart ApplicationsDesign Patterns for Smart Applications
Design Patterns for Smart Applications
Sri Ambati
 

What's hot (6)

Amruth-Testing
Amruth-TestingAmruth-Testing
Amruth-Testing
 
Depurando VBScript no InduSoft Web Studio
Depurando VBScript no InduSoft Web StudioDepurando VBScript no InduSoft Web Studio
Depurando VBScript no InduSoft Web Studio
 
HDC 2010 - Creating Quality Software: A Look at Visual Studio 2010 Testing Tools
HDC 2010 - Creating Quality Software: A Look at Visual Studio 2010 Testing ToolsHDC 2010 - Creating Quality Software: A Look at Visual Studio 2010 Testing Tools
HDC 2010 - Creating Quality Software: A Look at Visual Studio 2010 Testing Tools
 
Testing of Microservices in a Cloud Environment
Testing of Microservices in a Cloud EnvironmentTesting of Microservices in a Cloud Environment
Testing of Microservices in a Cloud Environment
 
Grading the Quality of Selenium Tests
Grading the Quality of Selenium TestsGrading the Quality of Selenium Tests
Grading the Quality of Selenium Tests
 
Design Patterns for Smart Applications
Design Patterns for Smart ApplicationsDesign Patterns for Smart Applications
Design Patterns for Smart Applications
 

Viewers also liked

8 DE MARZO EN EL PARLAMENTO EUROPEO MUJERES REFUGIADAS
8 DE MARZO EN EL PARLAMENTO EUROPEO MUJERES REFUGIADAS8 DE MARZO EN EL PARLAMENTO EUROPEO MUJERES REFUGIADAS
8 DE MARZO EN EL PARLAMENTO EUROPEO MUJERES REFUGIADAS
Tiemar Asociación
 
las tics y la enseñanza - consumos culturales
las tics y la enseñanza - consumos culturales las tics y la enseñanza - consumos culturales
las tics y la enseñanza - consumos culturales
yaniriquelme
 
Nada+Essam+El-din+Mohamed
Nada+Essam+El-din+MohamedNada+Essam+El-din+Mohamed
Nada+Essam+El-din+Mohamed
Nada Essam Eldin
 
DN - Coimbra com desempenho acima da média no turismo - Miguel Guedes de Sousa
DN - Coimbra com desempenho acima da média no turismo - Miguel Guedes de SousaDN - Coimbra com desempenho acima da média no turismo - Miguel Guedes de Sousa
DN - Coimbra com desempenho acima da média no turismo - Miguel Guedes de Sousa
Miguel Guedes de Sousa
 
Gerencia industrial
Gerencia industrialGerencia industrial
Gerencia industrial
adelavsierraltav
 
Testimonial Sören Venderby Origio May 2015
Testimonial Sören Venderby Origio May 2015Testimonial Sören Venderby Origio May 2015
Testimonial Sören Venderby Origio May 2015PhD Lars Johansson
 
rz_9_15
rz_9_15rz_9_15
rz_9_15
Chuck Pulham
 
Apresentação SR Consultoria
Apresentação SR ConsultoriaApresentação SR Consultoria
Apresentação SR Consultoria
Sueli Rodrigues
 
Document unic pentru achizițiile publice europene (DUAE)
Document unic pentru achizițiile publice europene (DUAE)Document unic pentru achizițiile publice europene (DUAE)
Document unic pentru achizițiile publice europene (DUAE)
licitatie-publica.ro Tender Service
 
Mardi 18 mme Géraldine Leduc - présentation ANETT
Mardi 18   mme Géraldine Leduc - présentation ANETTMardi 18   mme Géraldine Leduc - présentation ANETT
Mardi 18 mme Géraldine Leduc - présentation ANETT
Saint-Tropez Tourisme
 
Эффективность власти в решении проблем жителей Донбасса и временно перемещенн...
Эффективность власти в решении проблем жителей Донбасса и временно перемещенн...Эффективность власти в решении проблем жителей Донбасса и временно перемещенн...
Эффективность власти в решении проблем жителей Донбасса и временно перемещенн...
Restoring Donbass
 
AWS re:Invent 2016: Zillow Group: Developing Classification and Recommendatio...
AWS re:Invent 2016: Zillow Group: Developing Classification and Recommendatio...AWS re:Invent 2016: Zillow Group: Developing Classification and Recommendatio...
AWS re:Invent 2016: Zillow Group: Developing Classification and Recommendatio...
Amazon Web Services
 
Diseccion de riñones
Diseccion de riñonesDiseccion de riñones
Diseccion de riñones
Mary cielo Rodas
 
Eng9 american literature
Eng9 american literatureEng9 american literature
Eng9 american literature
Tine Lachica
 

Viewers also liked (16)

8 DE MARZO EN EL PARLAMENTO EUROPEO MUJERES REFUGIADAS
8 DE MARZO EN EL PARLAMENTO EUROPEO MUJERES REFUGIADAS8 DE MARZO EN EL PARLAMENTO EUROPEO MUJERES REFUGIADAS
8 DE MARZO EN EL PARLAMENTO EUROPEO MUJERES REFUGIADAS
 
las tics y la enseñanza - consumos culturales
las tics y la enseñanza - consumos culturales las tics y la enseñanza - consumos culturales
las tics y la enseñanza - consumos culturales
 
Nada+Essam+El-din+Mohamed
Nada+Essam+El-din+MohamedNada+Essam+El-din+Mohamed
Nada+Essam+El-din+Mohamed
 
DN - Coimbra com desempenho acima da média no turismo - Miguel Guedes de Sousa
DN - Coimbra com desempenho acima da média no turismo - Miguel Guedes de SousaDN - Coimbra com desempenho acima da média no turismo - Miguel Guedes de Sousa
DN - Coimbra com desempenho acima da média no turismo - Miguel Guedes de Sousa
 
Slide 1
Slide 1Slide 1
Slide 1
 
Gerencia industrial
Gerencia industrialGerencia industrial
Gerencia industrial
 
Testimonial Sören Venderby Origio May 2015
Testimonial Sören Venderby Origio May 2015Testimonial Sören Venderby Origio May 2015
Testimonial Sören Venderby Origio May 2015
 
MJE Core Expertise
MJE Core ExpertiseMJE Core Expertise
MJE Core Expertise
 
rz_9_15
rz_9_15rz_9_15
rz_9_15
 
Apresentação SR Consultoria
Apresentação SR ConsultoriaApresentação SR Consultoria
Apresentação SR Consultoria
 
Document unic pentru achizițiile publice europene (DUAE)
Document unic pentru achizițiile publice europene (DUAE)Document unic pentru achizițiile publice europene (DUAE)
Document unic pentru achizițiile publice europene (DUAE)
 
Mardi 18 mme Géraldine Leduc - présentation ANETT
Mardi 18   mme Géraldine Leduc - présentation ANETTMardi 18   mme Géraldine Leduc - présentation ANETT
Mardi 18 mme Géraldine Leduc - présentation ANETT
 
Эффективность власти в решении проблем жителей Донбасса и временно перемещенн...
Эффективность власти в решении проблем жителей Донбасса и временно перемещенн...Эффективность власти в решении проблем жителей Донбасса и временно перемещенн...
Эффективность власти в решении проблем жителей Донбасса и временно перемещенн...
 
AWS re:Invent 2016: Zillow Group: Developing Classification and Recommendatio...
AWS re:Invent 2016: Zillow Group: Developing Classification and Recommendatio...AWS re:Invent 2016: Zillow Group: Developing Classification and Recommendatio...
AWS re:Invent 2016: Zillow Group: Developing Classification and Recommendatio...
 
Diseccion de riñones
Diseccion de riñonesDiseccion de riñones
Diseccion de riñones
 
Eng9 american literature
Eng9 american literatureEng9 american literature
Eng9 american literature
 

Similar to Web forms and automated tests

Android Architectures
Android ArchitecturesAndroid Architectures
Android Architectures
Darshan Parikh
 
4. Introduction to ASP.NET MVC - Part I
4. Introduction to ASP.NET MVC - Part I4. Introduction to ASP.NET MVC - Part I
4. Introduction to ASP.NET MVC - Part I
Rohit Rao
 
Clean architecture on android
Clean architecture on androidClean architecture on android
Clean architecture on android
Benjamin Cheng
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentation
Volkan Uzun
 
CTTDNUG ASP.NET MVC
CTTDNUG ASP.NET MVCCTTDNUG ASP.NET MVC
CTTDNUG ASP.NET MVC
Barry Gervin
 
Introduction to asp.net mvc
Introduction to asp.net mvcIntroduction to asp.net mvc
Introduction to asp.net mvc
Lohith Goudagere Nagaraj
 
Debugging,Troubleshooting & Monitoring Distributed Web & Cloud Applications a...
Debugging,Troubleshooting & Monitoring Distributed Web & Cloud Applications a...Debugging,Troubleshooting & Monitoring Distributed Web & Cloud Applications a...
Debugging,Troubleshooting & Monitoring Distributed Web & Cloud Applications a...
Theo Jungeblut
 
Effective performance evaluation as part of a CI approach - Mission Impossible?
Effective performance evaluation as part of a CI approach - Mission Impossible?Effective performance evaluation as part of a CI approach - Mission Impossible?
Effective performance evaluation as part of a CI approach - Mission Impossible?
Intechnica
 
Mvc presentation
Mvc presentationMvc presentation
Mvc presentation
MaslowB
 
AngularJS Basics - Knowledge Sharing
AngularJS Basics - Knowledge SharingAngularJS Basics - Knowledge Sharing
AngularJS Basics - Knowledge Sharing
Branko Djurkovic
 
MVC Framework
MVC FrameworkMVC Framework
MVC Framework
Ashton Feller
 
Single Page Application presentation
Single Page Application presentationSingle Page Application presentation
Single Page Application presentation
John Staveley
 
Introduction To MVVM
Introduction To MVVMIntroduction To MVVM
Introduction To MVVM
Boulos Dib
 
ASP.net MVC Introduction Wikilogia (nov 2014)
ASP.net MVC Introduction Wikilogia (nov 2014)ASP.net MVC Introduction Wikilogia (nov 2014)
ASP.net MVC Introduction Wikilogia (nov 2014)
Hatem Hamad
 
Understanding ASP.NET MVC
Understanding ASP.NET MVCUnderstanding ASP.NET MVC
Understanding ASP.NET MVC
Shravan Kumar Kasagoni
 
Effort estimation for web applications
Effort estimation for web applicationsEffort estimation for web applications
Effort estimation for web applications
Nagaraja Gundappa
 
QAorHighway2016
QAorHighway2016QAorHighway2016
QAorHighway2016
Bhupesh Dahal
 
Introduction to-angular js
Introduction to-angular jsIntroduction to-angular js
Introduction to-angular js
Achintya Kumar
 
MVC architecture
MVC architectureMVC architecture
Automated Testing of Web Applications
Automated Testing of Web ApplicationsAutomated Testing of Web Applications
Automated Testing of Web Applications
jonatankronqvist
 

Similar to Web forms and automated tests (20)

Android Architectures
Android ArchitecturesAndroid Architectures
Android Architectures
 
4. Introduction to ASP.NET MVC - Part I
4. Introduction to ASP.NET MVC - Part I4. Introduction to ASP.NET MVC - Part I
4. Introduction to ASP.NET MVC - Part I
 
Clean architecture on android
Clean architecture on androidClean architecture on android
Clean architecture on android
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentation
 
CTTDNUG ASP.NET MVC
CTTDNUG ASP.NET MVCCTTDNUG ASP.NET MVC
CTTDNUG ASP.NET MVC
 
Introduction to asp.net mvc
Introduction to asp.net mvcIntroduction to asp.net mvc
Introduction to asp.net mvc
 
Debugging,Troubleshooting & Monitoring Distributed Web & Cloud Applications a...
Debugging,Troubleshooting & Monitoring Distributed Web & Cloud Applications a...Debugging,Troubleshooting & Monitoring Distributed Web & Cloud Applications a...
Debugging,Troubleshooting & Monitoring Distributed Web & Cloud Applications a...
 
Effective performance evaluation as part of a CI approach - Mission Impossible?
Effective performance evaluation as part of a CI approach - Mission Impossible?Effective performance evaluation as part of a CI approach - Mission Impossible?
Effective performance evaluation as part of a CI approach - Mission Impossible?
 
Mvc presentation
Mvc presentationMvc presentation
Mvc presentation
 
AngularJS Basics - Knowledge Sharing
AngularJS Basics - Knowledge SharingAngularJS Basics - Knowledge Sharing
AngularJS Basics - Knowledge Sharing
 
MVC Framework
MVC FrameworkMVC Framework
MVC Framework
 
Single Page Application presentation
Single Page Application presentationSingle Page Application presentation
Single Page Application presentation
 
Introduction To MVVM
Introduction To MVVMIntroduction To MVVM
Introduction To MVVM
 
ASP.net MVC Introduction Wikilogia (nov 2014)
ASP.net MVC Introduction Wikilogia (nov 2014)ASP.net MVC Introduction Wikilogia (nov 2014)
ASP.net MVC Introduction Wikilogia (nov 2014)
 
Understanding ASP.NET MVC
Understanding ASP.NET MVCUnderstanding ASP.NET MVC
Understanding ASP.NET MVC
 
Effort estimation for web applications
Effort estimation for web applicationsEffort estimation for web applications
Effort estimation for web applications
 
QAorHighway2016
QAorHighway2016QAorHighway2016
QAorHighway2016
 
Introduction to-angular js
Introduction to-angular jsIntroduction to-angular js
Introduction to-angular js
 
MVC architecture
MVC architectureMVC architecture
MVC architecture
 
Automated Testing of Web Applications
Automated Testing of Web ApplicationsAutomated Testing of Web Applications
Automated Testing of Web Applications
 

Recently uploaded

Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdfBaha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
Baha Majid
 
The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024
Yara Milbes
 
WMF 2024 - Unlocking the Future of Data Powering Next-Gen AI with Vector Data...
WMF 2024 - Unlocking the Future of Data Powering Next-Gen AI with Vector Data...WMF 2024 - Unlocking the Future of Data Powering Next-Gen AI with Vector Data...
WMF 2024 - Unlocking the Future of Data Powering Next-Gen AI with Vector Data...
Luigi Fugaro
 
The Comprehensive Guide to Validating Audio-Visual Performances.pdf
The Comprehensive Guide to Validating Audio-Visual Performances.pdfThe Comprehensive Guide to Validating Audio-Visual Performances.pdf
The Comprehensive Guide to Validating Audio-Visual Performances.pdf
kalichargn70th171
 
DevOps Consulting Company | Hire DevOps Services
DevOps Consulting Company | Hire DevOps ServicesDevOps Consulting Company | Hire DevOps Services
DevOps Consulting Company | Hire DevOps Services
seospiralmantra
 
TMU毕业证书精仿办理
TMU毕业证书精仿办理TMU毕业证书精仿办理
TMU毕业证书精仿办理
aeeva
 
美洲杯赔率投注网【​网址​🎉3977·EE​🎉】
美洲杯赔率投注网【​网址​🎉3977·EE​🎉】美洲杯赔率投注网【​网址​🎉3977·EE​🎉】
美洲杯赔率投注网【​网址​🎉3977·EE​🎉】
widenerjobeyrl638
 
Orca: Nocode Graphical Editor for Container Orchestration
Orca: Nocode Graphical Editor for Container OrchestrationOrca: Nocode Graphical Editor for Container Orchestration
Orca: Nocode Graphical Editor for Container Orchestration
Pedro J. Molina
 
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
kalichargn70th171
 
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
dakas1
 
一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理
dakas1
 
Upturn India Technologies - Web development company in Nashik
Upturn India Technologies - Web development company in NashikUpturn India Technologies - Web development company in Nashik
Upturn India Technologies - Web development company in Nashik
Upturn India Technologies
 
42 Ways to Generate Real Estate Leads - Sellxpert
42 Ways to Generate Real Estate Leads - Sellxpert42 Ways to Generate Real Estate Leads - Sellxpert
42 Ways to Generate Real Estate Leads - Sellxpert
vaishalijagtap12
 
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
XfilesPro
 
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
safelyiotech
 
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
kgyxske
 
Manyata Tech Park Bangalore_ Infrastructure, Facilities and More
Manyata Tech Park Bangalore_ Infrastructure, Facilities and MoreManyata Tech Park Bangalore_ Infrastructure, Facilities and More
Manyata Tech Park Bangalore_ Infrastructure, Facilities and More
narinav14
 
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
Paul Brebner
 
All you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVMAll you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVM
Alina Yurenko
 
Liberarsi dai framework con i Web Component.pptx
Liberarsi dai framework con i Web Component.pptxLiberarsi dai framework con i Web Component.pptx
Liberarsi dai framework con i Web Component.pptx
Massimo Artizzu
 

Recently uploaded (20)

Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdfBaha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
 
The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024
 
WMF 2024 - Unlocking the Future of Data Powering Next-Gen AI with Vector Data...
WMF 2024 - Unlocking the Future of Data Powering Next-Gen AI with Vector Data...WMF 2024 - Unlocking the Future of Data Powering Next-Gen AI with Vector Data...
WMF 2024 - Unlocking the Future of Data Powering Next-Gen AI with Vector Data...
 
The Comprehensive Guide to Validating Audio-Visual Performances.pdf
The Comprehensive Guide to Validating Audio-Visual Performances.pdfThe Comprehensive Guide to Validating Audio-Visual Performances.pdf
The Comprehensive Guide to Validating Audio-Visual Performances.pdf
 
DevOps Consulting Company | Hire DevOps Services
DevOps Consulting Company | Hire DevOps ServicesDevOps Consulting Company | Hire DevOps Services
DevOps Consulting Company | Hire DevOps Services
 
TMU毕业证书精仿办理
TMU毕业证书精仿办理TMU毕业证书精仿办理
TMU毕业证书精仿办理
 
美洲杯赔率投注网【​网址​🎉3977·EE​🎉】
美洲杯赔率投注网【​网址​🎉3977·EE​🎉】美洲杯赔率投注网【​网址​🎉3977·EE​🎉】
美洲杯赔率投注网【​网址​🎉3977·EE​🎉】
 
Orca: Nocode Graphical Editor for Container Orchestration
Orca: Nocode Graphical Editor for Container OrchestrationOrca: Nocode Graphical Editor for Container Orchestration
Orca: Nocode Graphical Editor for Container Orchestration
 
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
 
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
 
一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理
 
Upturn India Technologies - Web development company in Nashik
Upturn India Technologies - Web development company in NashikUpturn India Technologies - Web development company in Nashik
Upturn India Technologies - Web development company in Nashik
 
42 Ways to Generate Real Estate Leads - Sellxpert
42 Ways to Generate Real Estate Leads - Sellxpert42 Ways to Generate Real Estate Leads - Sellxpert
42 Ways to Generate Real Estate Leads - Sellxpert
 
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
 
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
 
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
 
Manyata Tech Park Bangalore_ Infrastructure, Facilities and More
Manyata Tech Park Bangalore_ Infrastructure, Facilities and MoreManyata Tech Park Bangalore_ Infrastructure, Facilities and More
Manyata Tech Park Bangalore_ Infrastructure, Facilities and More
 
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
 
All you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVMAll you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVM
 
Liberarsi dai framework con i Web Component.pptx
Liberarsi dai framework con i Web Component.pptxLiberarsi dai framework con i Web Component.pptx
Liberarsi dai framework con i Web Component.pptx
 

Web forms and automated tests

  • 1. Web Forms and automated tests Michali Konstantinidis All content by the author unless mentioned otherwise
  • 2. The problems ●No control over Page, Web and User Control creation ●Not isolating view from code-behind ○Access web form elements directly in code ●Dependency on ambient statics (Request, Response, Session, ViewState…) ●Automated tests next to impossible
  • 3. Some automated tests are still feasible ●Test end-to-end, from UI to database. ●No quick feedback, expensive to write ●Create/Update/Delete tests: Time- consuming database setup/teardowns ●Preconditions: Possible a large chain of test data with relationships
  • 4. I’m not saying not to have end-to- end tests A test harness just needs to look a bit like this... Manual tests UI/Acceptance tests Integration tests Unit tests
  • 5. Model-View-Presenter ●Derivative of the MVC ●The “view” (Web Forms Page) marshalls user requests, not the presenter ●Usually a 1-to-1 relationship exists between a view and a presenter
  • 7. Key Points ●Presenter contains UI logic, and delegates to business layer ●View marshalls requests and makes Web Forms components available to the Presenter ●The Presenter does not operate on concrete implementations, only on interfaces!
  • 8. Test Isolation ●Framework components accessible by statics can be wrapped or accessed via abstract classes, if available, and mocked ○Session - HttpSessionStateBase ○HttpContext - HttpContextWrapper ○Or make those available via a Page subclass ●Leave View with barely existing logic, making it not worth testing
  • 9. And, that’s (almost) it ●Circular reference between View and Presenter. “Newing-up” of objects should be done in one place, in a factory. ●Dependency Injection in Web Forms? ○Unity.WebForms - by S. Kyle Korndoerfer