As you begin building your automated GUI Testing Framework, the first set of tests you're likely to automate are those manual test cases, which, while required are perhaps mundane, repetitive, or require meticulous detailed review. The Behavior Driven Development (BDD) testing feature of Squish can easily help converting manual tests to automated tests.
Use existing manual test cases as your base
Sample manual test case: Create a new address book
- Start the application
- Create a new address book using application menus
- Expected result: New address book is created without any entries
Each item in the test case becomes a step in the feature file of the BDD test
Feature: Testing of the addressbook example
Scenario: Create a new address book
Given addressbook application is running
When I create a new address book
Then address book should have zero entries
After creating the Feature file, start recording implementation of steps
You can start recording either by clicking the red filled circle button next to test case name or right-click in the editor and select Record Missing Steps in Scenario.
The addressbook application should launch and you should be seeing the control bar after the recording has started:
Recording of the 1st step: Given addressbook application is running
- Once your application launches, click Finish recording this step button
Recording of the 2nd step: When I create a new address book
- Select File > New in the addressbook application
- Click Finish recording this step button
Recording of the 3rd step: Then address book should have zero entries
- Click Verify > Properties in the control bar
- When the Squish IDE appears, select Pick tool in the Application Objects toolbar
- Once the addressbook application reappears, click the empty table
- The properties of the picked object display in the Squish IDE's Properties window
- Check the rowCount property and click Save and Insert Verifications button
- When the control bar returns, click Finish recording this step button
The final implementation of steps should appear similar to the following in steps.py
import names
@Given("addressbook application is running")
def step(context):
startApplication("addressbook")
@When("I create a new address book")
def step(context):
activateItem(waitForObjectItem(names.address_Book_QMenuBar, "File"))
activateItem(waitForObjectItem(names.address_Book_File_QMenu, "New"))
@Then("address book should have zero entries")
def step(context):
test.compare(waitForObjectExists(names.address_Book_Unnamed_File_QTableWidget).rowCount, 0)
Read more about recording snippets and other related topics below
Try Squish out for free with a fully-supported and fully-functional trial of any Squish edition.