Tea time with testers feb 2014 year 4 issue i

Page 38

Jim h olme s

Text Content There are cases where you‘ll want to avoid fixed locators all together and instead think of querying objects on the page to retrieve information you need. I find myself doing this regularly when working with table or grid tests. If you‘re building a test that checks if you can properly retrieve data from a grid row, then you don‘t want that test reliant on the specific order or number of the row in the grid. In this case it makes a lot of sense to avoid locators, and instead get rows from the table that match a particular criteria. Using the table below, imagine a test whose purpose is to verify that clicking the Edit link on Jayne Cobb‘s row pulls up an editing grid with the proper values pre-populated. I wouldn‘t want this test to be dependent on the location of Jayne Cobb in the grid, nor would I want the test to fail if the Edit link changes columns.

Teatimewithtesters.com

February 2014|38


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.