SlideShare a Scribd company logo
1 of 86
@Ben_Hall
Ben@BenHall.me.uk
 Blog.BenHall.me.uk
Me?
Aim to this talk
• Allow you to make an informed, educated
  decision for your project.
• Know how to quickly get started if you want to
• Know alternative approaches if you don’t
Agenda
•   UI Browser Automation
•   Databases and Data Creation
•   Below the UI Testing
•   Group therapy

• Pain points, problems, concerns
• Best approaches to deal with these
What do I mean by
ASP.NET automated
acceptance testing?
Google Search

DEMO OF AUTOMATED TESTING
var driver = new FirefoxDriver(new FirefoxProfile());
driver.Navigate().GoToUrl("http://www.google.co.uk");
IWebElement searchbox = driver.FindElement(By.Name("q"));

searchbox.SendKeys("ASP.net");
searchbox.SendKeys(Keys.Enter);

var results = driver.FindElement(By.LinkText("Get Started with
   ASP.NET & ASP.NET MVC : Official Microsoft Site"))
Assert.IsNotNull(results);
Testing pipeline
• Outside in, driven from requirements
• TDD to drive inside aspects once UI
  automated

• Idealistic.. Doesn’t work. Expensive! (Will
  define this later)
Real World...
     •   Bring flexible to change
     •   Regression testing
     •   Pushing forward, rapidly.
     •   Protecting your own arse




http://4.bp.blogspot.com/-v6mzllgkJlM/Tm-yiM4fPEI/AAAAAAAAE34/7-BEetlvyHo/s1600/matrix1.jpg
• Focus on solving a pain you have.
• Automated UI Testing is one way, which
  works, but it’s not the only way.
• Hire a manual tester? Short-term gain, long
  term pain.
Pain you may have in the future

   Depends on the system / scenario.
   UI Tests may not be the best way
Spike and Stabilise

Get something out, get feedback,
         make it right.
It’s not all about code quality!

   Should not be the driving force
• Driving quality of your code via UI tests will kill
  your motivation for the entire project.
• IT HURTS! Been there, done that!
• Focus on what will help you deliver value
• Automated tests are expensive.

• How do you define value?
• Justify cost by delivering faster? Less bugs?
  Company loses less money?
Are “bugs” really bugs if they don’t
cost the company money nor annoy
              users?
Developers love making things complex




http://xkcd.com/974/
WHAT SHOULD YOU TEST?
Scenarios
• UI test should focus on scenarios
  – Behaviour.
  – Not actions.
A single test can save your career
Example of a 7digital career saver test
• 1) Can registered users add to basket and
  checkout?
• 2) Can people register

• Everything else is null and void if those don’t
  work
80/20 Rule

80% of the value comes from
        20% of tests
Design UI for testability
• Good CSS
• Good UX
• A bad UX will be extremely difficult to test
  – Code/Test smell!
<div>
 <div>
  <p>Some random text</p>
  <div>
       <p>Error Message</p>
  </div>
 </div>
</div>
                                            Much easier to test!
<div>
 <div>
  <p>Some random text</p>
  <div>
       <p class=“error”>Error Message</p>
  </div>
 </div>
</div>
Safety net when refactoring
        legacy code
• TDD Rules do apply – naming
• TDD doesn’t – single assertion
Automated tests against production
• Everything before (TDD, Staging etc) is just a
  precaution
• If it goes live and it’s dead – it’s pointless.
• Focused smoke tests
CODE & TOOLS
Selenium WebDriver
WebDriver is AMAZING!!!

  Google, Mozilla, Community
Creating a browser instance
new FirefoxDriver(new FirefoxProfile());

new InternetExplorerDriver();

new ChromeDriver(@".")

                                chromedriver.exe
Element Locator Strategies
Basically jQuery

driver.FindElement(By.Name("q"));
driver.FindElement(By.ClassName(“error-msg"))
driver.FindElement(By.Id("album-list"))
Page Interactions
Basically jQuery

.Text
.Click()
.Submit()
.SendKeys()  Used for inputing text
Executing JS
public static T ExecuteJS<T>(IWebDriver driver, string js) {
  IJavaScriptExecutor jsExecute = driver as IJavaScriptExecutor;
  return (T)jsExecute.ExecuteScript(js);
}



$(“.NewHeader.header .earn .dropdown-menu”).show();
Patiently Waiting
var time = new TimeSpan(0, 0, 30);
var timeouts = driver.Manage().Timeouts();
timeouts.ImplicitlyWait(time);
Patiently Waiting Longer
Use JS code / test hooks in application

window.SWAPP.isReady === true
[TestFixtureSetUp]
 public void CreateDriver() {
 _driver = new FirefoxDriver(new FirefoxProfile());
  _driver.Manage().Timeouts().ImplicitlyWait(new TimeSpan(0, 0,
   30));
}

 [SetUp]
 public void NavigateToWebpage() {
   _driver.Navigate().GoToUrl(WebApp.URL);
}

[TestFixtureTearDown]
public void FixtureTearDown() {
  if (_driver != null)
     _driver.Close();
}
But I told everyone to use Ruby
When tests fail have good
  debugging output
public static string TakeScreenshot(IWebDriver driver)
{
  string file = Path.GetTempFileName() + ".png";
  var s = ((ITakesScreenshot)driver);

    s.GetScreenshot().SaveAsFile(file, ImageFormat.Png);

    return file;
}
FUNDAMENTAL PROBLEM

      Websites change.
   Or at least they should.
public class ItemListing
{
    IWebDriver _driver;
    public ItemListing(IWebDriver driver) {
       _driver = driver;
    }

    public void AddToCart()
    {
      _driver.FindElement(By.Id("addToCart")).Click();
    }
}
TEA PLEASE
• MVC Music Store
• http://www.github.com
• /BenHall/ProgNet2012

• HelloWorldExamples/
• Installers/
• MVCMusicStore/
1. Test that item appears on the homepage
2. Automate adding an item to the basket



• Pair – Great opportunity.
YOUR TURN
http://www.github.com
/BenHall/ProgNet2012
public int HeaderCount(string cartCount) {
   var regex = new Regex(@"^Cart ((d+))$");
   var match = regex.Match(cartCount);
   var i = match.Groups[1].Captures[0].Value;
   return Convert.ToInt32(i);
 }
Thanks
So what did I do?
SLOW!!




http://www.flickr.com/photos/57734740@N00/184375292/
Internet Explorer
SetUp : System.InvalidOperationException :
  Unexpected error launching Internet Explorer.
  Protected Mode must be set to the same
  value (enabled or disabled) for all zones.
  (NoSuchDriver)
Complex Xpath / CSS Selectors

table[@id='foo2']/tbody/tr/td/a[contains(text(),'whatever')]
Don’t care about the minor details
• CSS downloading correctly...
• Other ways to solve that problem without UI
  testing
Form validation
• Could it be a unit test?
• Do you need to run it every time if it hasn’t
  changed?
• It’s a risk – how calculated is it?
DATABASES
CACHING

http://www.flickr.com/photos/gagilas/2659695352/
LEGACY DATABASE SCHEMA

http://www.flickr.com/photos/gagilas/2659695352/
Highly Coupled workflow
• UI Tests become highly coupled to the UI and
  existing workflow

• UI changes – or at least should. Tests will
  break, need maintenance etc - BAD
Data Builders
• Be able to test website against a clean empty
  database
• Build only the data your tests need
• REALLY hard with a legacy system
  – Focus on long term and take small steps to get
    there
Example
var u =new UserCreator(“Name”, 13)
       .WithOptionalValue(“Of Something”)
       .WithCart(p1, p2, p3)
       .Build();



UserDeleter.Delete(u)
Simple.Data / Lightweight ORM
db.Users.Insert(Name: "steve", Age: 50)




https://github.com/markrendle/Simple.Data/wiki/Inserting-and-updating-
   data
Shared database
•   Be careful
•   Tests clash
•   Use random keys when inserting (not 1-10)
•   Delete only the data you insert
TEA PLEASE
WHY USE A BROWSER?
MVC Test Automation
       Framework
Hosts ASP.NET in it’s own AppDomain
        Didn’t work for me.
CassiniDev
CassiniDevServer server = new CassiniDevServer();
server.StartServer(Path.Combine(Environment.Curre
  ntDirectory,
  @"......CassiniDevHostingExample"));
string url = server.NormalizeUrl("/");
EasyHTTP and CSQuery
EasyHTTP – Get / Dynamic
var http = new HttpClient();
http.Request.Accept =
  HttpContentTypes.ApplicationJson;
var response = http.Get("url");
var customer = response.DynamicBody;
Console.WriteLine("Name {0}", customer.Name);
EasyHTTP - Post
var customer = new Customer();
customer.Name = "Joe";
customer.Email = "joe@smith.com";
var http = new HttpClient();
http.Post("url", customer,
  HttpContentTypes.ApplicationJson);
CSQuery
var sel = dom.Select("a");

var id = dom[0].id;
var href = dom[0]["href"];

dom.Each((i,e) => {
    if (e.id == "remove-this-id") {
         e.Parent().RemoveChild(e);
    }
});
var url = "http://www.amazon.co.uk/s/ref=nb_sb_noss_2?url=search-
   alias%3Daps&field-keywords=Testing+ASP.net&x=0&y=0"

var httpClient = new HttpClient();
var response = httpClient.Get(url);
var dom = CsQuery.CQ.Create(response.RawText);
StringAssert.Contains("Ben Hall", dom.Find(".ptBrand").Text());
var url = "
   http://search.twitter.com/search.json?q=prognet&&rpp=5&includ
   e_entities=true&result_type=mixed "

var httpClient = new HttpClient();
 var response = httpClient.Get(url);
 Assert.That(response.DynamicBody.results.Length > 0);
1. Host MVCMusicStore using CassiniDev
2. Test that item appears on the homepage

• Feel free to download completed solution
YOUR TURN
http://www.flickr.com/photos/buro9/298994863/




 VSTest & Record / Playback
    • Record / Playback
    • VSTest



    • Not every tool helps!
• Chrome Dev Tool + Console - AMAZING
http://www.flickr.com/photos/leon_homan/2856628778/
Before you write a test think

what would happen if this failed in production
      for 30 minutes? 4 hours? 3 days?
           Would anyone care?
      Would something else catch it?
Focus on true value
• Mix different approaches – Hezies 57




http://www.gourmetsteaks.com/wp-content/uploads/steak-sauce-heinz-57.jpg
“Running UI Tests”
http://www.flickr.com/photos/philliecasablanca/245684098
6/




                                                                    @Ben_Hall
                                                           Ben@BenHall.me.uk
                                                            Blog.BenHall.me.uk

More Related Content

What's hot

Building Quality with Foundations of Mud
Building Quality with Foundations of MudBuilding Quality with Foundations of Mud
Building Quality with Foundations of Mudseleniumconf
 
Page Objects Done Right - selenium conference 2014
Page Objects Done Right - selenium conference 2014Page Objects Done Right - selenium conference 2014
Page Objects Done Right - selenium conference 2014Oren Rubin
 
Efficient Rails Test Driven Development (class 4) by Wolfram Arnold
Efficient Rails Test Driven Development (class 4) by Wolfram ArnoldEfficient Rails Test Driven Development (class 4) by Wolfram Arnold
Efficient Rails Test Driven Development (class 4) by Wolfram ArnoldMarakana Inc.
 
Out of box page object design pattern, java
Out of box page object design pattern, javaOut of box page object design pattern, java
Out of box page object design pattern, javaCOMAQA.BY
 
Token Testing Slides
Token  Testing SlidesToken  Testing Slides
Token Testing Slidesericholscher
 
A journey beyond the page object pattern
A journey beyond the page object patternA journey beyond the page object pattern
A journey beyond the page object patternRiverGlide
 
How to make Ajax work for you
How to make Ajax work for youHow to make Ajax work for you
How to make Ajax work for youSimon Willison
 
Javascript unit testing, yes we can e big
Javascript unit testing, yes we can   e bigJavascript unit testing, yes we can   e big
Javascript unit testing, yes we can e bigAndy Peterson
 
Unit Testing JavaScript Applications
Unit Testing JavaScript ApplicationsUnit Testing JavaScript Applications
Unit Testing JavaScript ApplicationsYnon Perek
 
Introduction to Protractor
Introduction to ProtractorIntroduction to Protractor
Introduction to ProtractorJie-Wei Wu
 
Intro To JavaScript Unit Testing - Ran Mizrahi
Intro To JavaScript Unit Testing - Ran MizrahiIntro To JavaScript Unit Testing - Ran Mizrahi
Intro To JavaScript Unit Testing - Ran MizrahiRan Mizrahi
 
CBDW2014 - MockBox, get ready to mock your socks off!
CBDW2014 - MockBox, get ready to mock your socks off!CBDW2014 - MockBox, get ready to mock your socks off!
CBDW2014 - MockBox, get ready to mock your socks off!Ortus Solutions, Corp
 
Selenide alternative in Python - Introducing Selene [SeleniumCamp 2016]
Selenide alternative in Python - Introducing Selene [SeleniumCamp 2016]Selenide alternative in Python - Introducing Selene [SeleniumCamp 2016]
Selenide alternative in Python - Introducing Selene [SeleniumCamp 2016]Iakiv Kramarenko
 
Building a JavaScript Library
Building a JavaScript LibraryBuilding a JavaScript Library
Building a JavaScript Libraryjeresig
 
Developer Tests - Things to Know
Developer Tests - Things to KnowDeveloper Tests - Things to Know
Developer Tests - Things to KnowVaidas Pilkauskas
 
Top100summit 谷歌-scott-improve your automated web application testing
Top100summit  谷歌-scott-improve your automated web application testingTop100summit  谷歌-scott-improve your automated web application testing
Top100summit 谷歌-scott-improve your automated web application testingdrewz lin
 
Internet Explorer 8 for Developers by Christian Thilmany
Internet Explorer 8 for Developers by Christian ThilmanyInternet Explorer 8 for Developers by Christian Thilmany
Internet Explorer 8 for Developers by Christian ThilmanyChristian Thilmany
 
Painless JavaScript Testing with Jest
Painless JavaScript Testing with JestPainless JavaScript Testing with Jest
Painless JavaScript Testing with JestMichał Pierzchała
 

What's hot (20)

Building Quality with Foundations of Mud
Building Quality with Foundations of MudBuilding Quality with Foundations of Mud
Building Quality with Foundations of Mud
 
KISS Automation.py
KISS Automation.pyKISS Automation.py
KISS Automation.py
 
Page Objects Done Right - selenium conference 2014
Page Objects Done Right - selenium conference 2014Page Objects Done Right - selenium conference 2014
Page Objects Done Right - selenium conference 2014
 
Efficient Rails Test Driven Development (class 4) by Wolfram Arnold
Efficient Rails Test Driven Development (class 4) by Wolfram ArnoldEfficient Rails Test Driven Development (class 4) by Wolfram Arnold
Efficient Rails Test Driven Development (class 4) by Wolfram Arnold
 
Out of box page object design pattern, java
Out of box page object design pattern, javaOut of box page object design pattern, java
Out of box page object design pattern, java
 
Token Testing Slides
Token  Testing SlidesToken  Testing Slides
Token Testing Slides
 
Django Testing
Django TestingDjango Testing
Django Testing
 
A journey beyond the page object pattern
A journey beyond the page object patternA journey beyond the page object pattern
A journey beyond the page object pattern
 
How to make Ajax work for you
How to make Ajax work for youHow to make Ajax work for you
How to make Ajax work for you
 
Javascript unit testing, yes we can e big
Javascript unit testing, yes we can   e bigJavascript unit testing, yes we can   e big
Javascript unit testing, yes we can e big
 
Unit Testing JavaScript Applications
Unit Testing JavaScript ApplicationsUnit Testing JavaScript Applications
Unit Testing JavaScript Applications
 
Introduction to Protractor
Introduction to ProtractorIntroduction to Protractor
Introduction to Protractor
 
Intro To JavaScript Unit Testing - Ran Mizrahi
Intro To JavaScript Unit Testing - Ran MizrahiIntro To JavaScript Unit Testing - Ran Mizrahi
Intro To JavaScript Unit Testing - Ran Mizrahi
 
CBDW2014 - MockBox, get ready to mock your socks off!
CBDW2014 - MockBox, get ready to mock your socks off!CBDW2014 - MockBox, get ready to mock your socks off!
CBDW2014 - MockBox, get ready to mock your socks off!
 
Selenide alternative in Python - Introducing Selene [SeleniumCamp 2016]
Selenide alternative in Python - Introducing Selene [SeleniumCamp 2016]Selenide alternative in Python - Introducing Selene [SeleniumCamp 2016]
Selenide alternative in Python - Introducing Selene [SeleniumCamp 2016]
 
Building a JavaScript Library
Building a JavaScript LibraryBuilding a JavaScript Library
Building a JavaScript Library
 
Developer Tests - Things to Know
Developer Tests - Things to KnowDeveloper Tests - Things to Know
Developer Tests - Things to Know
 
Top100summit 谷歌-scott-improve your automated web application testing
Top100summit  谷歌-scott-improve your automated web application testingTop100summit  谷歌-scott-improve your automated web application testing
Top100summit 谷歌-scott-improve your automated web application testing
 
Internet Explorer 8 for Developers by Christian Thilmany
Internet Explorer 8 for Developers by Christian ThilmanyInternet Explorer 8 for Developers by Christian Thilmany
Internet Explorer 8 for Developers by Christian Thilmany
 
Painless JavaScript Testing with Jest
Painless JavaScript Testing with JestPainless JavaScript Testing with Jest
Painless JavaScript Testing with Jest
 

Viewers also liked

Node.js Anti Patterns
Node.js Anti PatternsNode.js Anti Patterns
Node.js Anti PatternsBen Hall
 
What Designs Need To Know About Visual Design
What Designs Need To Know About Visual DesignWhat Designs Need To Know About Visual Design
What Designs Need To Know About Visual DesignBen Hall
 
Taking advantage of the Amazon Web Services (AWS) Family
Taking advantage of the Amazon Web Services (AWS) FamilyTaking advantage of the Amazon Web Services (AWS) Family
Taking advantage of the Amazon Web Services (AWS) FamilyBen Hall
 
Lessons from running potentially malicious code inside Docker containers
Lessons from running potentially malicious code inside Docker containersLessons from running potentially malicious code inside Docker containers
Lessons from running potentially malicious code inside Docker containersBen Hall
 
Continuous deployment
Continuous deploymentContinuous deployment
Continuous deploymentBen Hall
 
The Art Of Building Prototypes and MVPs
The Art Of Building Prototypes and MVPsThe Art Of Building Prototypes and MVPs
The Art Of Building Prototypes and MVPsBen Hall
 
Real World Lessons on the Pain Points of Node.js Applications
Real World Lessons on the Pain Points of Node.js ApplicationsReal World Lessons on the Pain Points of Node.js Applications
Real World Lessons on the Pain Points of Node.js ApplicationsBen Hall
 
Running Docker in Development & Production (DevSum 2015)
Running Docker in Development & Production (DevSum 2015)Running Docker in Development & Production (DevSum 2015)
Running Docker in Development & Production (DevSum 2015)Ben Hall
 
Kata - Devops CDSummit LA 2015
Kata - Devops CDSummit LA 2015 Kata - Devops CDSummit LA 2015
Kata - Devops CDSummit LA 2015 John Willis
 
Learning Patterns for the Overworked Developer
Learning Patterns for the Overworked DeveloperLearning Patterns for the Overworked Developer
Learning Patterns for the Overworked DeveloperBen Hall
 
Alibaba Cloud Conference 2016 - Docker Open Source
Alibaba Cloud Conference   2016 - Docker Open Source Alibaba Cloud Conference   2016 - Docker Open Source
Alibaba Cloud Conference 2016 - Docker Open Source John Willis
 
Running Docker in Development & Production (#ndcoslo 2015)
Running Docker in Development & Production (#ndcoslo 2015)Running Docker in Development & Production (#ndcoslo 2015)
Running Docker in Development & Production (#ndcoslo 2015)Ben Hall
 
Implementing Google's Material Design Guidelines
Implementing Google's Material Design GuidelinesImplementing Google's Material Design Guidelines
Implementing Google's Material Design GuidelinesBen Hall
 
Architecting .NET Applications for Docker and Container Based Deployments
Architecting .NET Applications for Docker and Container Based DeploymentsArchitecting .NET Applications for Docker and Container Based Deployments
Architecting .NET Applications for Docker and Container Based DeploymentsBen Hall
 
Deploying Windows Containers on Windows Server 2016
Deploying Windows Containers on Windows Server 2016Deploying Windows Containers on Windows Server 2016
Deploying Windows Containers on Windows Server 2016Ben Hall
 
Lessons from running potentially malicious code inside containers
Lessons from running potentially malicious code inside containersLessons from running potentially malicious code inside containers
Lessons from running potentially malicious code inside containersBen Hall
 
The How and Why of Windows containers
The How and Why of Windows containersThe How and Why of Windows containers
The How and Why of Windows containersBen Hall
 
Real World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and ProductionReal World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and ProductionBen Hall
 
How I learned to stop worrying and love the cloud
How I learned to stop worrying and love the cloudHow I learned to stop worrying and love the cloud
How I learned to stop worrying and love the cloudShlomo Swidler
 
Deploying applications to Windows Server 2016 and Windows Containers
Deploying applications to Windows Server 2016 and Windows ContainersDeploying applications to Windows Server 2016 and Windows Containers
Deploying applications to Windows Server 2016 and Windows ContainersBen Hall
 

Viewers also liked (20)

Node.js Anti Patterns
Node.js Anti PatternsNode.js Anti Patterns
Node.js Anti Patterns
 
What Designs Need To Know About Visual Design
What Designs Need To Know About Visual DesignWhat Designs Need To Know About Visual Design
What Designs Need To Know About Visual Design
 
Taking advantage of the Amazon Web Services (AWS) Family
Taking advantage of the Amazon Web Services (AWS) FamilyTaking advantage of the Amazon Web Services (AWS) Family
Taking advantage of the Amazon Web Services (AWS) Family
 
Lessons from running potentially malicious code inside Docker containers
Lessons from running potentially malicious code inside Docker containersLessons from running potentially malicious code inside Docker containers
Lessons from running potentially malicious code inside Docker containers
 
Continuous deployment
Continuous deploymentContinuous deployment
Continuous deployment
 
The Art Of Building Prototypes and MVPs
The Art Of Building Prototypes and MVPsThe Art Of Building Prototypes and MVPs
The Art Of Building Prototypes and MVPs
 
Real World Lessons on the Pain Points of Node.js Applications
Real World Lessons on the Pain Points of Node.js ApplicationsReal World Lessons on the Pain Points of Node.js Applications
Real World Lessons on the Pain Points of Node.js Applications
 
Running Docker in Development & Production (DevSum 2015)
Running Docker in Development & Production (DevSum 2015)Running Docker in Development & Production (DevSum 2015)
Running Docker in Development & Production (DevSum 2015)
 
Kata - Devops CDSummit LA 2015
Kata - Devops CDSummit LA 2015 Kata - Devops CDSummit LA 2015
Kata - Devops CDSummit LA 2015
 
Learning Patterns for the Overworked Developer
Learning Patterns for the Overworked DeveloperLearning Patterns for the Overworked Developer
Learning Patterns for the Overworked Developer
 
Alibaba Cloud Conference 2016 - Docker Open Source
Alibaba Cloud Conference   2016 - Docker Open Source Alibaba Cloud Conference   2016 - Docker Open Source
Alibaba Cloud Conference 2016 - Docker Open Source
 
Running Docker in Development & Production (#ndcoslo 2015)
Running Docker in Development & Production (#ndcoslo 2015)Running Docker in Development & Production (#ndcoslo 2015)
Running Docker in Development & Production (#ndcoslo 2015)
 
Implementing Google's Material Design Guidelines
Implementing Google's Material Design GuidelinesImplementing Google's Material Design Guidelines
Implementing Google's Material Design Guidelines
 
Architecting .NET Applications for Docker and Container Based Deployments
Architecting .NET Applications for Docker and Container Based DeploymentsArchitecting .NET Applications for Docker and Container Based Deployments
Architecting .NET Applications for Docker and Container Based Deployments
 
Deploying Windows Containers on Windows Server 2016
Deploying Windows Containers on Windows Server 2016Deploying Windows Containers on Windows Server 2016
Deploying Windows Containers on Windows Server 2016
 
Lessons from running potentially malicious code inside containers
Lessons from running potentially malicious code inside containersLessons from running potentially malicious code inside containers
Lessons from running potentially malicious code inside containers
 
The How and Why of Windows containers
The How and Why of Windows containersThe How and Why of Windows containers
The How and Why of Windows containers
 
Real World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and ProductionReal World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and Production
 
How I learned to stop worrying and love the cloud
How I learned to stop worrying and love the cloudHow I learned to stop worrying and love the cloud
How I learned to stop worrying and love the cloud
 
Deploying applications to Windows Server 2016 and Windows Containers
Deploying applications to Windows Server 2016 and Windows ContainersDeploying applications to Windows Server 2016 and Windows Containers
Deploying applications to Windows Server 2016 and Windows Containers
 

Similar to Testing ASP.NET - Progressive.NET

Javascript first-class citizenery
Javascript first-class citizeneryJavascript first-class citizenery
Javascript first-class citizenerytoddbr
 
Pragmatic Parallels: Java and JavaScript
Pragmatic Parallels: Java and JavaScriptPragmatic Parallels: Java and JavaScript
Pragmatic Parallels: Java and JavaScriptdavejohnson
 
UI Testing Automation
UI Testing AutomationUI Testing Automation
UI Testing AutomationAgileEngine
 
Browser Automated Testing Frameworks - Nightwatch.js
Browser Automated Testing Frameworks - Nightwatch.jsBrowser Automated Testing Frameworks - Nightwatch.js
Browser Automated Testing Frameworks - Nightwatch.jsLuís Bastião Silva
 
Automated Frontend Testing
Automated Frontend TestingAutomated Frontend Testing
Automated Frontend TestingNeil Crosby
 
3 Ways to test your ColdFusion API - 2017 Adobe CF Summit
3 Ways to test your ColdFusion API - 2017 Adobe CF Summit3 Ways to test your ColdFusion API - 2017 Adobe CF Summit
3 Ways to test your ColdFusion API - 2017 Adobe CF SummitOrtus Solutions, Corp
 
Testing for fun in production Into The Box 2018
Testing for fun in production Into The Box 2018Testing for fun in production Into The Box 2018
Testing for fun in production Into The Box 2018Ortus Solutions, Corp
 
JavaScript front end performance optimizations
JavaScript front end performance optimizationsJavaScript front end performance optimizations
JavaScript front end performance optimizationsChris Love
 
Improving Your Selenium WebDriver Tests - Belgium testing days_2016
Improving Your Selenium WebDriver Tests - Belgium testing days_2016Improving Your Selenium WebDriver Tests - Belgium testing days_2016
Improving Your Selenium WebDriver Tests - Belgium testing days_2016Roy de Kleijn
 
6 Traits of a Successful Test Automation Architecture
6 Traits of a Successful Test Automation Architecture6 Traits of a Successful Test Automation Architecture
6 Traits of a Successful Test Automation ArchitectureErdem YILDIRIM
 
Building frameworks over Selenium
Building frameworks over SeleniumBuilding frameworks over Selenium
Building frameworks over SeleniumCristian COȚOI
 
Continuous Delivery - Automate & Build Better Software with Travis CI
Continuous Delivery - Automate & Build Better Software with Travis CIContinuous Delivery - Automate & Build Better Software with Travis CI
Continuous Delivery - Automate & Build Better Software with Travis CIwajrcs
 
Using Selenium to Improve a Teams Development Cycle
Using Selenium to Improve a Teams Development CycleUsing Selenium to Improve a Teams Development Cycle
Using Selenium to Improve a Teams Development Cycleseleniumconf
 
Session on Selenium Powertools by Unmesh Gundecha
Session on Selenium Powertools by Unmesh GundechaSession on Selenium Powertools by Unmesh Gundecha
Session on Selenium Powertools by Unmesh GundechaAgile Testing Alliance
 
Testing in AngularJS
Testing in AngularJSTesting in AngularJS
Testing in AngularJSPeter Drinnan
 
jQuery in the [Aol.] Enterprise
jQuery in the [Aol.] EnterprisejQuery in the [Aol.] Enterprise
jQuery in the [Aol.] EnterpriseDave Artz
 
Automated acceptance test
Automated acceptance testAutomated acceptance test
Automated acceptance testBryan Liu
 
Node.js Development Workflow Automation with Grunt.js
Node.js Development Workflow Automation with Grunt.jsNode.js Development Workflow Automation with Grunt.js
Node.js Development Workflow Automation with Grunt.jskiyanwang
 
A Sampling of Tools
A Sampling of ToolsA Sampling of Tools
A Sampling of ToolsDawn Code
 

Similar to Testing ASP.NET - Progressive.NET (20)

Javascript first-class citizenery
Javascript first-class citizeneryJavascript first-class citizenery
Javascript first-class citizenery
 
Pragmatic Parallels: Java and JavaScript
Pragmatic Parallels: Java and JavaScriptPragmatic Parallels: Java and JavaScript
Pragmatic Parallels: Java and JavaScript
 
UI Testing Automation
UI Testing AutomationUI Testing Automation
UI Testing Automation
 
Browser Automated Testing Frameworks - Nightwatch.js
Browser Automated Testing Frameworks - Nightwatch.jsBrowser Automated Testing Frameworks - Nightwatch.js
Browser Automated Testing Frameworks - Nightwatch.js
 
Automated Frontend Testing
Automated Frontend TestingAutomated Frontend Testing
Automated Frontend Testing
 
3 Ways to test your ColdFusion API - 2017 Adobe CF Summit
3 Ways to test your ColdFusion API - 2017 Adobe CF Summit3 Ways to test your ColdFusion API - 2017 Adobe CF Summit
3 Ways to test your ColdFusion API - 2017 Adobe CF Summit
 
Testing for fun in production Into The Box 2018
Testing for fun in production Into The Box 2018Testing for fun in production Into The Box 2018
Testing for fun in production Into The Box 2018
 
JavaScript front end performance optimizations
JavaScript front end performance optimizationsJavaScript front end performance optimizations
JavaScript front end performance optimizations
 
Improving Your Selenium WebDriver Tests - Belgium testing days_2016
Improving Your Selenium WebDriver Tests - Belgium testing days_2016Improving Your Selenium WebDriver Tests - Belgium testing days_2016
Improving Your Selenium WebDriver Tests - Belgium testing days_2016
 
6 Traits of a Successful Test Automation Architecture
6 Traits of a Successful Test Automation Architecture6 Traits of a Successful Test Automation Architecture
6 Traits of a Successful Test Automation Architecture
 
Building frameworks over Selenium
Building frameworks over SeleniumBuilding frameworks over Selenium
Building frameworks over Selenium
 
Continuous Delivery - Automate & Build Better Software with Travis CI
Continuous Delivery - Automate & Build Better Software with Travis CIContinuous Delivery - Automate & Build Better Software with Travis CI
Continuous Delivery - Automate & Build Better Software with Travis CI
 
Using Selenium to Improve a Teams Development Cycle
Using Selenium to Improve a Teams Development CycleUsing Selenium to Improve a Teams Development Cycle
Using Selenium to Improve a Teams Development Cycle
 
Session on Selenium Powertools by Unmesh Gundecha
Session on Selenium Powertools by Unmesh GundechaSession on Selenium Powertools by Unmesh Gundecha
Session on Selenium Powertools by Unmesh Gundecha
 
Testing in AngularJS
Testing in AngularJSTesting in AngularJS
Testing in AngularJS
 
Selenium
SeleniumSelenium
Selenium
 
jQuery in the [Aol.] Enterprise
jQuery in the [Aol.] EnterprisejQuery in the [Aol.] Enterprise
jQuery in the [Aol.] Enterprise
 
Automated acceptance test
Automated acceptance testAutomated acceptance test
Automated acceptance test
 
Node.js Development Workflow Automation with Grunt.js
Node.js Development Workflow Automation with Grunt.jsNode.js Development Workflow Automation with Grunt.js
Node.js Development Workflow Automation with Grunt.js
 
A Sampling of Tools
A Sampling of ToolsA Sampling of Tools
A Sampling of Tools
 

More from Ben Hall

The Art Of Documentation - NDC Porto 2022
The Art Of Documentation - NDC Porto 2022The Art Of Documentation - NDC Porto 2022
The Art Of Documentation - NDC Porto 2022Ben Hall
 
The Art Of Documentation for Open Source Projects
The Art Of Documentation for Open Source ProjectsThe Art Of Documentation for Open Source Projects
The Art Of Documentation for Open Source ProjectsBen Hall
 
Three Years of Lessons Running Potentially Malicious Code Inside Containers
Three Years of Lessons Running Potentially Malicious Code Inside ContainersThree Years of Lessons Running Potentially Malicious Code Inside Containers
Three Years of Lessons Running Potentially Malicious Code Inside ContainersBen Hall
 
Containers without docker
Containers without dockerContainers without docker
Containers without dockerBen Hall
 
Deploying windows containers with kubernetes
Deploying windows containers with kubernetesDeploying windows containers with kubernetes
Deploying windows containers with kubernetesBen Hall
 
The Art of Documentation and Readme.md for Open Source Projects
The Art of Documentation and Readme.md for Open Source ProjectsThe Art of Documentation and Readme.md for Open Source Projects
The Art of Documentation and Readme.md for Open Source ProjectsBen Hall
 
How Secure Are Docker Containers?
How Secure Are Docker Containers?How Secure Are Docker Containers?
How Secure Are Docker Containers?Ben Hall
 
The Challenges of Becoming Cloud Native
The Challenges of Becoming Cloud NativeThe Challenges of Becoming Cloud Native
The Challenges of Becoming Cloud NativeBen Hall
 
Scaling Docker Containers using Kubernetes and Azure Container Service
Scaling Docker Containers using Kubernetes and Azure Container ServiceScaling Docker Containers using Kubernetes and Azure Container Service
Scaling Docker Containers using Kubernetes and Azure Container ServiceBen Hall
 
The art of documentation and readme.md
The art of documentation and readme.mdThe art of documentation and readme.md
The art of documentation and readme.mdBen Hall
 
Experimenting and Learning Kubernetes and Tensorflow
Experimenting and Learning Kubernetes and TensorflowExperimenting and Learning Kubernetes and Tensorflow
Experimenting and Learning Kubernetes and TensorflowBen Hall
 
Running .NET on Docker
Running .NET on DockerRunning .NET on Docker
Running .NET on DockerBen Hall
 
Real World Lessons on the Pain Points of Node.JS Application
Real World Lessons on the Pain Points of Node.JS ApplicationReal World Lessons on the Pain Points of Node.JS Application
Real World Lessons on the Pain Points of Node.JS ApplicationBen Hall
 
Tips on solving E_TOO_MANY_THINGS_TO_LEARN with Kubernetes
Tips on solving E_TOO_MANY_THINGS_TO_LEARN with KubernetesTips on solving E_TOO_MANY_THINGS_TO_LEARN with Kubernetes
Tips on solving E_TOO_MANY_THINGS_TO_LEARN with KubernetesBen Hall
 
Real World Lessons On The Anti-Patterns of Node.JS
Real World Lessons On The Anti-Patterns of Node.JSReal World Lessons On The Anti-Patterns of Node.JS
Real World Lessons On The Anti-Patterns of Node.JSBen Hall
 

More from Ben Hall (15)

The Art Of Documentation - NDC Porto 2022
The Art Of Documentation - NDC Porto 2022The Art Of Documentation - NDC Porto 2022
The Art Of Documentation - NDC Porto 2022
 
The Art Of Documentation for Open Source Projects
The Art Of Documentation for Open Source ProjectsThe Art Of Documentation for Open Source Projects
The Art Of Documentation for Open Source Projects
 
Three Years of Lessons Running Potentially Malicious Code Inside Containers
Three Years of Lessons Running Potentially Malicious Code Inside ContainersThree Years of Lessons Running Potentially Malicious Code Inside Containers
Three Years of Lessons Running Potentially Malicious Code Inside Containers
 
Containers without docker
Containers without dockerContainers without docker
Containers without docker
 
Deploying windows containers with kubernetes
Deploying windows containers with kubernetesDeploying windows containers with kubernetes
Deploying windows containers with kubernetes
 
The Art of Documentation and Readme.md for Open Source Projects
The Art of Documentation and Readme.md for Open Source ProjectsThe Art of Documentation and Readme.md for Open Source Projects
The Art of Documentation and Readme.md for Open Source Projects
 
How Secure Are Docker Containers?
How Secure Are Docker Containers?How Secure Are Docker Containers?
How Secure Are Docker Containers?
 
The Challenges of Becoming Cloud Native
The Challenges of Becoming Cloud NativeThe Challenges of Becoming Cloud Native
The Challenges of Becoming Cloud Native
 
Scaling Docker Containers using Kubernetes and Azure Container Service
Scaling Docker Containers using Kubernetes and Azure Container ServiceScaling Docker Containers using Kubernetes and Azure Container Service
Scaling Docker Containers using Kubernetes and Azure Container Service
 
The art of documentation and readme.md
The art of documentation and readme.mdThe art of documentation and readme.md
The art of documentation and readme.md
 
Experimenting and Learning Kubernetes and Tensorflow
Experimenting and Learning Kubernetes and TensorflowExperimenting and Learning Kubernetes and Tensorflow
Experimenting and Learning Kubernetes and Tensorflow
 
Running .NET on Docker
Running .NET on DockerRunning .NET on Docker
Running .NET on Docker
 
Real World Lessons on the Pain Points of Node.JS Application
Real World Lessons on the Pain Points of Node.JS ApplicationReal World Lessons on the Pain Points of Node.JS Application
Real World Lessons on the Pain Points of Node.JS Application
 
Tips on solving E_TOO_MANY_THINGS_TO_LEARN with Kubernetes
Tips on solving E_TOO_MANY_THINGS_TO_LEARN with KubernetesTips on solving E_TOO_MANY_THINGS_TO_LEARN with Kubernetes
Tips on solving E_TOO_MANY_THINGS_TO_LEARN with Kubernetes
 
Real World Lessons On The Anti-Patterns of Node.JS
Real World Lessons On The Anti-Patterns of Node.JSReal World Lessons On The Anti-Patterns of Node.JS
Real World Lessons On The Anti-Patterns of Node.JS
 

Recently uploaded

Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 

Recently uploaded (20)

E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 

Testing ASP.NET - Progressive.NET

  • 2. Me?
  • 3. Aim to this talk • Allow you to make an informed, educated decision for your project. • Know how to quickly get started if you want to • Know alternative approaches if you don’t
  • 4. Agenda • UI Browser Automation • Databases and Data Creation • Below the UI Testing • Group therapy • Pain points, problems, concerns • Best approaches to deal with these
  • 5. What do I mean by ASP.NET automated acceptance testing?
  • 6. Google Search DEMO OF AUTOMATED TESTING
  • 7. var driver = new FirefoxDriver(new FirefoxProfile()); driver.Navigate().GoToUrl("http://www.google.co.uk"); IWebElement searchbox = driver.FindElement(By.Name("q")); searchbox.SendKeys("ASP.net"); searchbox.SendKeys(Keys.Enter); var results = driver.FindElement(By.LinkText("Get Started with ASP.NET & ASP.NET MVC : Official Microsoft Site")) Assert.IsNotNull(results);
  • 8. Testing pipeline • Outside in, driven from requirements • TDD to drive inside aspects once UI automated • Idealistic.. Doesn’t work. Expensive! (Will define this later)
  • 9. Real World... • Bring flexible to change • Regression testing • Pushing forward, rapidly. • Protecting your own arse http://4.bp.blogspot.com/-v6mzllgkJlM/Tm-yiM4fPEI/AAAAAAAAE34/7-BEetlvyHo/s1600/matrix1.jpg
  • 10.
  • 11. • Focus on solving a pain you have. • Automated UI Testing is one way, which works, but it’s not the only way. • Hire a manual tester? Short-term gain, long term pain.
  • 12. Pain you may have in the future Depends on the system / scenario. UI Tests may not be the best way
  • 13. Spike and Stabilise Get something out, get feedback, make it right.
  • 14. It’s not all about code quality! Should not be the driving force
  • 15. • Driving quality of your code via UI tests will kill your motivation for the entire project. • IT HURTS! Been there, done that!
  • 16. • Focus on what will help you deliver value • Automated tests are expensive. • How do you define value? • Justify cost by delivering faster? Less bugs? Company loses less money?
  • 17. Are “bugs” really bugs if they don’t cost the company money nor annoy users?
  • 18. Developers love making things complex http://xkcd.com/974/
  • 20. Scenarios • UI test should focus on scenarios – Behaviour. – Not actions.
  • 21. A single test can save your career
  • 22. Example of a 7digital career saver test • 1) Can registered users add to basket and checkout? • 2) Can people register • Everything else is null and void if those don’t work
  • 23. 80/20 Rule 80% of the value comes from 20% of tests
  • 24. Design UI for testability • Good CSS • Good UX • A bad UX will be extremely difficult to test – Code/Test smell!
  • 25. <div> <div> <p>Some random text</p> <div> <p>Error Message</p> </div> </div> </div> Much easier to test! <div> <div> <p>Some random text</p> <div> <p class=“error”>Error Message</p> </div> </div> </div>
  • 26. Safety net when refactoring legacy code
  • 27. • TDD Rules do apply – naming • TDD doesn’t – single assertion
  • 28. Automated tests against production • Everything before (TDD, Staging etc) is just a precaution • If it goes live and it’s dead – it’s pointless. • Focused smoke tests
  • 31. WebDriver is AMAZING!!! Google, Mozilla, Community
  • 32. Creating a browser instance new FirefoxDriver(new FirefoxProfile()); new InternetExplorerDriver(); new ChromeDriver(@".") chromedriver.exe
  • 33. Element Locator Strategies Basically jQuery driver.FindElement(By.Name("q")); driver.FindElement(By.ClassName(“error-msg")) driver.FindElement(By.Id("album-list"))
  • 35. Executing JS public static T ExecuteJS<T>(IWebDriver driver, string js) { IJavaScriptExecutor jsExecute = driver as IJavaScriptExecutor; return (T)jsExecute.ExecuteScript(js); } $(“.NewHeader.header .earn .dropdown-menu”).show();
  • 36. Patiently Waiting var time = new TimeSpan(0, 0, 30); var timeouts = driver.Manage().Timeouts(); timeouts.ImplicitlyWait(time);
  • 37. Patiently Waiting Longer Use JS code / test hooks in application window.SWAPP.isReady === true
  • 38. [TestFixtureSetUp] public void CreateDriver() { _driver = new FirefoxDriver(new FirefoxProfile()); _driver.Manage().Timeouts().ImplicitlyWait(new TimeSpan(0, 0, 30)); } [SetUp] public void NavigateToWebpage() { _driver.Navigate().GoToUrl(WebApp.URL); } [TestFixtureTearDown] public void FixtureTearDown() { if (_driver != null) _driver.Close(); }
  • 39. But I told everyone to use Ruby
  • 40. When tests fail have good debugging output
  • 41. public static string TakeScreenshot(IWebDriver driver) { string file = Path.GetTempFileName() + ".png"; var s = ((ITakesScreenshot)driver); s.GetScreenshot().SaveAsFile(file, ImageFormat.Png); return file; }
  • 42. FUNDAMENTAL PROBLEM Websites change. Or at least they should.
  • 43. public class ItemListing { IWebDriver _driver; public ItemListing(IWebDriver driver) { _driver = driver; } public void AddToCart() { _driver.FindElement(By.Id("addToCart")).Click(); } }
  • 45. • MVC Music Store
  • 46. • http://www.github.com • /BenHall/ProgNet2012 • HelloWorldExamples/ • Installers/ • MVCMusicStore/
  • 47. 1. Test that item appears on the homepage 2. Automate adding an item to the basket • Pair – Great opportunity.
  • 49. public int HeaderCount(string cartCount) { var regex = new Regex(@"^Cart ((d+))$"); var match = regex.Match(cartCount); var i = match.Groups[1].Captures[0].Value; return Convert.ToInt32(i); }
  • 51.
  • 53. Internet Explorer SetUp : System.InvalidOperationException : Unexpected error launching Internet Explorer. Protected Mode must be set to the same value (enabled or disabled) for all zones. (NoSuchDriver)
  • 54. Complex Xpath / CSS Selectors table[@id='foo2']/tbody/tr/td/a[contains(text(),'whatever')]
  • 55. Don’t care about the minor details • CSS downloading correctly... • Other ways to solve that problem without UI testing
  • 56. Form validation • Could it be a unit test? • Do you need to run it every time if it hasn’t changed? • It’s a risk – how calculated is it?
  • 60. Highly Coupled workflow • UI Tests become highly coupled to the UI and existing workflow • UI changes – or at least should. Tests will break, need maintenance etc - BAD
  • 61. Data Builders • Be able to test website against a clean empty database • Build only the data your tests need • REALLY hard with a legacy system – Focus on long term and take small steps to get there
  • 62. Example var u =new UserCreator(“Name”, 13) .WithOptionalValue(“Of Something”) .WithCart(p1, p2, p3) .Build(); UserDeleter.Delete(u)
  • 63. Simple.Data / Lightweight ORM db.Users.Insert(Name: "steve", Age: 50) https://github.com/markrendle/Simple.Data/wiki/Inserting-and-updating- data
  • 64. Shared database • Be careful • Tests clash • Use random keys when inserting (not 1-10) • Delete only the data you insert
  • 66. WHY USE A BROWSER?
  • 67. MVC Test Automation Framework Hosts ASP.NET in it’s own AppDomain Didn’t work for me.
  • 69. CassiniDevServer server = new CassiniDevServer(); server.StartServer(Path.Combine(Environment.Curre ntDirectory, @"......CassiniDevHostingExample")); string url = server.NormalizeUrl("/");
  • 71. EasyHTTP – Get / Dynamic var http = new HttpClient(); http.Request.Accept = HttpContentTypes.ApplicationJson; var response = http.Get("url"); var customer = response.DynamicBody; Console.WriteLine("Name {0}", customer.Name);
  • 72. EasyHTTP - Post var customer = new Customer(); customer.Name = "Joe"; customer.Email = "joe@smith.com"; var http = new HttpClient(); http.Post("url", customer, HttpContentTypes.ApplicationJson);
  • 73. CSQuery var sel = dom.Select("a"); var id = dom[0].id; var href = dom[0]["href"]; dom.Each((i,e) => { if (e.id == "remove-this-id") { e.Parent().RemoveChild(e); } });
  • 74. var url = "http://www.amazon.co.uk/s/ref=nb_sb_noss_2?url=search- alias%3Daps&field-keywords=Testing+ASP.net&x=0&y=0" var httpClient = new HttpClient(); var response = httpClient.Get(url); var dom = CsQuery.CQ.Create(response.RawText); StringAssert.Contains("Ben Hall", dom.Find(".ptBrand").Text());
  • 75. var url = " http://search.twitter.com/search.json?q=prognet&&rpp=5&includ e_entities=true&result_type=mixed " var httpClient = new HttpClient(); var response = httpClient.Get(url); Assert.That(response.DynamicBody.results.Length > 0);
  • 76. 1. Host MVCMusicStore using CassiniDev 2. Test that item appears on the homepage • Feel free to download completed solution
  • 78. http://www.flickr.com/photos/buro9/298994863/ VSTest & Record / Playback • Record / Playback • VSTest • Not every tool helps!
  • 79. • Chrome Dev Tool + Console - AMAZING
  • 81. Before you write a test think what would happen if this failed in production for 30 minutes? 4 hours? 3 days? Would anyone care? Would something else catch it?
  • 82. Focus on true value
  • 83. • Mix different approaches – Hezies 57 http://www.gourmetsteaks.com/wp-content/uploads/steak-sauce-heinz-57.jpg
  • 84.
  • 86. http://www.flickr.com/photos/philliecasablanca/245684098 6/ @Ben_Hall Ben@BenHall.me.uk Blog.BenHall.me.uk

Editor's Notes

  1. Ability to have an automated way to ensure that your application works on an end-to-end basis and it’s safe to deploy. Potentially a massive pain Potentially a massive life saver It all depends on how you approach it, it’s about the decisions.
  2. - Know when to break the rules. He can, he has experience. - Personally, I prefer to focus on what works
  3. $(“.NewHeader.header .earn .dropdown-menu”).show();