Come let us explore together…

Posts tagged ‘Stores test item’

Data handling support in TestComplete – Part 2


2. Stores:

In TestComplete each project can have its own ‘Stores’ test item. It is a collection of various file types which can be accessed by project scripts. It can be directly added to any project by simply right clicking the <Project_Name> -> Add -> New Item -> Stores.

Collection of files, objects, and images organized as Stores.

Stores_as_project_item

The advantage of having such collection is, it gives access to complete repository of required data in various data formats. Mostly it can be used for verification of expected results and data source for across AUT.

The stores collections can accommodate data in below formats,

  • DBTables – To store tables and queries.
  • Files – To store Text or Data files of any type.
  • Objects – Used to store object properties in XML format
  • Regions – Image formats like BMP, JPEG, PNG, TIFF or GIF.
  • Tables – To store AUT control’s data that display information in a tabular form.
  • WebTesting – Web page controls/items used to compare and verify web pages.
  • XML – To store xml documents.

When you record a scenario and need verification point to test, you will recognize/compare object/properties. These items are in turn added to Stores object by the recorder while saving the scripts. Generally when you use ‘Checkpoints’ in your script, the expected data/files will be stored under stores collection.

Manually also we can add items to the collection thru right clicking the stores item, select ‘New Item/Existing Item’ option and browse for suitable item/file.

a) Scope:

‘Global’ to its project. The stores items are saved inside the project itself by default. We can also alter the location to store in different path. But this makes some dependability while moving the projects. Both the script units and keyword tests has access to this collection.

b) Easy Accessible:

The stores collection is accessible using object called ‘Stores’ inside ‘ScriptExtensions’ and using objects – DBTables, Files, Objects, Regions, Tables, WebTesting, XML inside scripts. Through these object we can refer its corresponding methods which helps us greatly in manipulation our data during execution.

The objects – Files, Objects, Regions and XML has general methods to add files, compare them, check for existence, get them by name/index and delete them. The remaining objects – DBTables, Tables, WebTesting have methods based on the instances in them.

These objects/files are independent of script languages and TestComplete supports all the methods and properties to access these files in any of its five scripting languages supported.

c) Adapting to changes:

The items/collections present in the project can be added/ updated/ deleted any time by with fewer mouse click actions. TestComplete provides easy wizard like forms to add/update the items and well informed UI to view the data in the files. For example let us see how the data in XML file is shown in TestComplete.

XMLViewer through which XML files can be viewed and edited

XMLViewer_in_Stores

Just like the screen shot it displays our files (expected, checkpoints) in well understanding manner and provides options to update the files. You can simply switch over to the ‘Source’ tab here to edit the XML file and save to update it. Similarly the many of the ‘Stores’ files can be easily updated right inside test complete.

One more advantage in using Stores is we can update the stores object/files in one click. If the AUT has gone for any change and the expected results/checkpoints need to be updated to the latest version of the product, simply we can ask TestComplete to update the object instead of checking/comparing it. So when the tests run, TestComplete will update its stored objects based on the mapping in the Stores. Use the Tools -> Options dialog to configure the compare/update setup as below in the figure.

Navigate to Tools-> Options-> Engines-> Stores dialog to update Stores collection

Update_Stores_Collections

To be continued..

Hope there are 101 ways to Automate !!!
Thanks & Regards,
Giri Prasad