Create

Use language specific DSL to create TableData instance: Groovy ["Col A" | "Col B" | "Col C"] { ________________________________ "v1a" | "v1b" | "v1c" "v2a" | "v2b" | "v2c" } Java table("Col A", "Col B", "Col C", ________________________________, "v1a", "v1b", "v1c", "v2a", "v2b", "v2c") Note: The example above assumes import static org.testingisdocumenting.webtau.WebTauCore.* or import static org.testingisdocumenting.webtau.WebTauDsl.* . Additionally WebTauCore has header-separating lines defined using underscores ___ of various lengths, which you can optionally use for aesthetics. Using ____ underscore is optional and is there for aesthetics only Groovy ["Col A" | "Col B" | "Col C"] { "v1a" | "v1b" | "v1c" "v2a" | "v2b" | "v2c" } Java table("Col A", "Col B", "Col C").values( "v1a", "v1b", "v1c", "v2a", "v2b", "v2c")

Key Columns

Use * in front of a column to specify it as a key column Groovy ["*id" | "Name" | "Type"] { ___________________________ "id1" | "N" | "T" "id2" | "N2" | "T2" "id3" | "N" | "T" } Java table("*id" , "Name" , "Type", _______________________, "id1" , "N" , "T", "id2" , "N2" , "T2", "id3" , "N" , "T") To access a value by key column Groovy def found = tableData.find(key("id2")) found.Name.should == "N2" Java Record found = tableData.find(key("id2")); actual(found.get("Name")).should(equal("N2")); To change key columns of an existing table Groovy tableData.withNewKeyColumns("Name", "Type") Java tableData.withNewKeyColumns("Name", "Type") Note: withNewKeyColumns creates new table and validates new key column uniqueness

Permutations

Use permute(v1, v2) to automatically generate multiple rows. Groovy ["Col A" | "Col B" | "Col C"] { ___________________________________________________________ permute(true, false) | "v1b" | permute('a', 'b') "v2a" | permute(10, 20) | "v2c" } Java table("Col A" , "Col B" , "Col C", ________________________________________________________________, permute(true, false), "v1b" , permute('a', 'b'), "v2a" , permute(10, 20) , "v2c") Col A Col B Col C true v1b a false v1b a true v1b b false v1b b v2a 10 v2c v2a 20 v2c

GUID

Use cell.guid to automatically generate unique ids. Groovy ["ID" | "Col A" | "Col B" | "Col C"] { ________________________________________________________________________ cell.guid | permute(true, false) | "v1b" | permute('a', 'b') cell.guid | "v2a" | permute(10, 20) | "v2c" } Java table("ID" , "Col A" , "Col B" , "Col C", ______________________________________________________________________, cell.guid, permute(true, false), "v1b" , permute('a', 'b'), cell.guid, "v2a" , permute(10, 20) , "v2c") ID Col A Col B Col C 718d2f8a-e909-4d05-873c-d560eef75fe5 true v1b a d05d2791-9cdd-4713-94d2-03173ed42320 false v1b a 69489cf1-1b03-4e48-8a28-0ce7b76564bc true v1b b 9f5f707d-7f87-4663-ab7b-185e448efafe false v1b b 23d07b91-8938-40ab-b20e-12336132a27e v2a 10 v2c 3fa37d3a-e80c-42e3-a3c6-6e13b23374a3 v2a 20 v2c

Replace

Use table.replace(before, after) to replace values in a table. Groovy ["Col A" | "Col B" | "Col C"] { ________________________________ "v1a" | "v1b" | "v1c" "v2a" | "v2b" | "v2c" } tableData.replace("v1b", "v1b_") Java table("Col A", "Col B", "Col C", ________________________________, "v1a", "v1b", "v1c", "v2a", "v2b", "v2c") tableData.replace("v1b", "v1b_") Col A Col B Col C v1a v1b_ v1c v2a v2b v2c

Cell Above Value Reference

Use cell.above to refer to the previous row value Groovy ["Name" | "Start Date" | "Games To Play" ] { ______________________________________________________ "John" | LocalDate.of(2016, 6, 20) | 10 "Bob" | cell.above | 8 "Mike" | cell.above | 14 "Drew" | LocalDate.of(2016, 6, 22) | 10 "Pete" | cell.above | 11 "Max" | cell.above | 3 } Java table("Name", "Start Date" , "Games To Play", __________________________________________________, "John", LocalDate.of(2016, 6, 20), 10, "Bob" , cell.above , 8, "Mike", cell.above , 14, "Drew", LocalDate.of(2016, 6, 22), 10, "Pete", cell.above , 11, "Max" , cell.above , 3) Name Start Date Games To Play John 2016-06-20 10 Bob 2016-06-20 8 Mike 2016-06-20 14 Drew 2016-06-22 10 Pete 2016-06-22 11 Max 2016-06-22 3

Cell Above Math

Use cell.above.plus|minus to generate a derived value based on the previous row value Groovy ["Name" | "Start Date" | "Games To Play" ] { ______________________________________________________ "John" | LocalDate.of(2016, 6, 20) | 10 "Bob" | cell.above | cell.above + 1 "Mike" | cell.above | cell.above + 1 } Java table("Name", "Start Date" , "Games To Play", ________________________________________________________________, "John", LocalDate.of(2016, 6, 20), 10, "Bob" , cell.above , cell.above.plus(1), "Mike", cell.above , cell.above.plus(1)) Name Start Date Games To Play John 2016-06-20 10 Bob 2016-06-20 11 Mike 2016-06-20 12 Extract cell.above.operation to make your intentions clearer Groovy def increment = cell.above + 1 ["Name" | "Start Date" | "Games To Play" ] { ______________________________________________________ "John" | LocalDate.of(2016, 6, 20) | 10 "Bob" | cell.above | increment "Mike" | cell.above | increment } Java TableDataCellValueGenerator<?> increment = cell.above.plus(1) table("Name", "Start Date" , "Games To Play", ________________________________________________________________, "John", LocalDate.of(2016, 6, 20), 10, "Bob" , cell.above , increment, "Mike", cell.above , increment)