tfat external

12
A Test Data-driven A Test Data-driven Test Framework Test Framework with with Watir and Rasta Watir and Rasta Presented to the Austin Workshop on Presented to the Austin Workshop on Automated Testing Automated Testing by by Gregg Yows Gregg Yows Sr. Test Automation Engineer Sr. Test Automation Engineer Texas Windstorm Insurance Agency Texas Windstorm Insurance Agency

Upload: gregg-yows

Post on 14-Apr-2017

534 views

Category:

Technology


2 download

TRANSCRIPT

Page 1: TFAT External

A Test Data-driven A Test Data-driven Test Framework Test Framework

with with Watir and RastaWatir and Rasta

Presented to the Austin Workshop on Presented to the Austin Workshop on Automated TestingAutomated Testing

byby

Gregg YowsGregg YowsSr. Test Automation EngineerSr. Test Automation Engineer

Texas Windstorm Insurance AgencyTexas Windstorm Insurance Agency

Page 2: TFAT External

AUT – Unique AUT – Unique CharacteristicsCharacteristics

Primary purpose of Website – Generates insurance quotes and Primary purpose of Website – Generates insurance quotes and applicationsapplications

Presentation – Apache Tomcat / JSPPresentation – Apache Tomcat / JSP Persistence - MicrosoftPersistence - Microsoft™ ™ SQL Server 2005SQL Server 2005 Supported browsers - IE 6.xSupported browsers - IE 6.x ““Wizard-like” and “un-wizard-like” formsWizard-like” and “un-wizard-like” forms Most forms are dynamically generated and modular. This makes for Most forms are dynamically generated and modular. This makes for

un-predictable form layouts from step-to-step.un-predictable form layouts from step-to-step.

Page 3: TFAT External

AUT – WorkflowAUT – Workflow

• Standard login • 7 options• Each option generates different Step 3

Step 3Step 2Step 1

Step 4 Step 5

• 7 possible layouts determined by Step 2

• Over 30 possible layouts determined by Step 2 and Step 3

• Final result and verification point

Page 4: TFAT External

TFAT(WP) - ComponentsTFAT(WP) - ComponentsFixture Code

Test Driver Spreadsheet (Inputs / Outputs)

Page 5: TFAT External

TFAT(WP) - ComponentsTFAT(WP) - ComponentsFixture Code Subcomponents

Main Fixtures

Helper Classes

GUI Map

Page 6: TFAT External

TFAT(WP) - ComponentsTFAT(WP) - ComponentsFixture Code – Main Fixtures

Require Rasta, Watir and helper files

Class name matches worksheet tab

Accessors required for all attributes from spreadsheet used in fixture

Includes (Watir, Rasta)

Setup/Teardown methods (similar to FIT)

Test methods (called from spreadsheet via Rasta)

Page 7: TFAT External

TFAT(WP) - ComponentsTFAT(WP) - ComponentsFixture Code Subcomponents – Helper Libraries

Helper methods

Database Helpers

Page 8: TFAT External

TFAT(WP) - ComponentsTFAT(WP) - ComponentsFixture Code Subcomponents – GUI Map

Method to ID HTML element

Method to “act” on element if exists.

Data to populate field passed from spreadsheet via test fixture

Page 9: TFAT External

TFAT(WP) - ComponentsTFAT(WP) - ComponentsTest Driver Spreadsheet – Data

Page ElementsPage Element Data• Used as method parameters

in GUI map and fixtures

• Naming convention keeps method names same as page/form element name

• Changes in page elements can quickly be modified

• Used as method parameters in GUI map and fixtures

• Naming convention keeps method names same as page/form element name

• Changes in page elements can quickly be modified

Tests• Map to test methods in fixture

• Naming convention should clarify test purpose

Assertions• Similar to nUnit assertion method parameters

• Values can be T/F or contain expected results

• Resuts are returned from the Test method in the fixture.

Page 10: TFAT External

TFAT(WP) - ComponentsTFAT(WP) - ComponentsTest Driver Spreadsheet – Configurability

Linked Attributes• Most elements have limited attributes available to them

• These are captured in the “values” worksheet

• Values are linked using Excel’s built-in cell validation feature

• This allows very rapid test case creation – just copy the test case into a new column and modify an attribute with known values.

• Makes it unecessary to have AUT active in order to create new test cases.

Page 11: TFAT External

TFAT(WP) – In Action!TFAT(WP) – In Action!AUT

Play AUT Screen cast

Page 12: TFAT External

TFAT(WP) – In Action!TFAT(WP) – In Action!Framework

Play Spreadsheet Screen cast