Using Tbox Excel Modules to read in and manipulate data
We will create a brief example test case to show how to use the new Tbox Excel Modules.
Being able to bring in excel contents to Tosca, and manupulate them like a table while using constraints, a new feature for Tosca 12.1!
We can buffer and use constraints on specific cells that contain header/column attributes, just like a regular Tbox table in Tosca.
In this example, we will guide you through using the new Tbox Excel Modules for Tosca Commander 12.1+. The new modules will be used to refence your excel sheet exactly like a modern Tbox Table. Something previously not possible with older versions of Tosca.
1) First we will need to create a new project and import the standard modules. In here you'll notice the new Tbox Excel modules are located at Tbox Standard Modules -> Tbox XEngines -> Excel.
2) Next, we will drag the Tbox Open Excel Workbook module to our test case. In it, we will enter the location of our workbook in the path variable and the Workbook Name will become an instance of that open workbook for use in the following steps.
3) Drag the Tbox Define Excel Range module into the test case. The Workbook Name will be brought from step #2 above, the Worksheet Name is the name of worksheet in the excel file. In our case, Sheet1. The Range Name will be a variable used by Tosca Commander for future steps and is up to your discretion. The Data Range is the cell range on the test sheet that we would like to read. It uses the cell letter and number, in our case A1 to Z1000. There is no real limit on size here but the larger the area the more processing and memory that will be required.
4) Add to your Test case Tbox Excel Range Manipulation, we will use the range name setup in the previous step - "R1". Next, we can use the Data Table attribute to manipulate the excel data like any other table in Tosca. In our case, we wish to find the name of a product, set it as a contraint, and then return it's value from the excel sheet into our buffer called "Test_ExcelBuffer".
5) Running our test steps we retrieve the correct value from the Excel File, and our buffer is now set to "Value3".
I hope you can see the potential power of this. With the conversion to Tbox modules, we now have a control over Excel that was previously either very difficult and even impossible in certain circumstances.
For more table steering ideas, please reference the subject of Table Steering from our support site.