Automated Website Testing

20
Automated Website Testing [email protected]

description

Automated Website Testing. [email protected]. About Me. Product Architect at VC3 VC3 Academic Suite Etc… Find me at: [email protected] mhoop.wordpress.com. WatiN (“ What-in”). watin.sourceforge.net .NET assembly ( watir is Ruby version) API for controlling web browser, and DOM. - PowerPoint PPT Presentation

Transcript of Automated Website Testing

Page 1: Automated Website Testing

Automated Website Testing

[email protected]

Page 2: Automated Website Testing

About Me

• Product Architect at VC3– VC3 Academic Suite– Etc…

• Find me at:– [email protected]– mhoop.wordpress.com

Page 3: Automated Website Testing

WatiN (“What-in”)

• watin.sourceforge.net• .NET assembly (watir is Ruby version)• API for controlling web browser, and DOM.– Ajax support

WatiNWeb

Browser.exe Web site

Page 4: Automated Website Testing

WatiN Functionality

• Search for elements by ID, etc– Regex’s too

• Interact with DOM to simulate user– button clicking– typing

Page 5: Automated Website Testing

WatiN Demo

Page 6: Automated Website Testing

A Web App

• TestView is 6 years old• Periodic team changes• Continuous enhancements• Customer hosted (intranet)• Size:– 15+ Visual Studio projects– 600+ db tables– 600+ .aspx files– 3000+ .cs files (app-specific)– And code shared across all VC3 apps

Page 7: Automated Website Testing

Testing Needs

• More obvious:– Enhancements, bug fixes

• Less obvious:– What did we break? (regression tests)

Goal: Improve quality and delivery speed

Page 8: Automated Website Testing

How WatiN fits in

WatiN

Browser

exerciseand verify

Test Runner

run andmanage

setup preconditions, verify results

Page1Page1

Tests

Web Site

Page 9: Automated Website Testing

How WatiN fits in

WatiN

Browser

exerciseand verify

Database

Visual Studio

run andmanage

setup preconditions, verify results

Page1Page1

Tests

Web Site

Page 10: Automated Website Testing

Why full stack testing?

Testing against the UI isnatural and

end-user oriented

Page 11: Automated Website Testing

Testing Approaches

UsersFull stack

tests

Real World

UI

Model

Data

Unittestsvs

Page 12: Automated Website Testing

Developer Tendencies

1. Code2. Test– find data to test in db– use the UI to perform actions– verify results

3. Fix4. Repeat until satisfied

Page 13: Automated Website Testing

Developer Tendencies

1. Code2. Test– find data to test in db– use the UI to perform actions– verify results

3. Fix4. Repeat until satisfied

Automate!

Page 14: Automated Website Testing

UI Automation Challenges

Interface can be:• Complex• Dynamic• Fluid over lifetime

Page 15: Automated Website Testing

Cleaner Tests

SignInWithGoodCredentials SignInPageUserNamePassword

SignInButtonNoSignInWithBadCredentials

WatiN

• Encapsulate ID’s etc in page model classes• Makes tests more readable (example)

Page 16: Automated Website Testing

Design goals for tests

• Easy to write (and read)• Isolated from UI brittleness• Start from a known state– no side effects ideally

• Test a specific case/scenario• Consider overlap among tests

Page 17: Automated Website Testing

Our Results

• Added a layer on WatiN to simplify tests

Page 18: Automated Website Testing

Our Results

• Incrementally adding tests• No side effects is key• Useful for long efforts• Slow to run large number of tests• Tests have helped with regression tests• Response from developers– Mostly positive– Writing good tests is hard!

Page 19: Automated Website Testing

Your Website?

• More complex monitoring

• Regression tests– CMS upgrades– Server migrations

Page 20: Automated Website Testing

Other Links

• Email testing– nDumbster: http://ndumbster.sourceforge.net