tfat external
TRANSCRIPT
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
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.
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
TFAT(WP) - ComponentsTFAT(WP) - ComponentsFixture Code
Test Driver Spreadsheet (Inputs / Outputs)
TFAT(WP) - ComponentsTFAT(WP) - ComponentsFixture Code Subcomponents
Main Fixtures
Helper Classes
GUI Map
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)
TFAT(WP) - ComponentsTFAT(WP) - ComponentsFixture Code Subcomponents – Helper Libraries
Helper methods
Database Helpers
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
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.
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.
TFAT(WP) – In Action!TFAT(WP) – In Action!AUT
Play AUT Screen cast
TFAT(WP) – In Action!TFAT(WP) – In Action!Framework
Play Spreadsheet Screen cast