? QA Design Gurus: TTS Tips: Explicitly adding element to element repository and understanding it's auto generated meta data

Feb 8, 2016

TTS Tips: Explicitly adding element to element repository and understanding it's auto generated meta data



There are mainly two ways to add element to element repository:
1. By recording test step (See my post about this here)
2. By adding element explicitly to element repository

There are two ways to explicitly add element to element repository:
A. From the browser
B. From the recorder

A. From the browser:

To do this, first we have to select "Highlight Element" in the recorder. Once it is done, we should able to highlight the elements in the browser.

Do following steps to add element to element repository,
a. Go to required element and mouse over it then you should able to see list of options.
b. Select Add to Elements, then friendly name pop-up will be populated.
c. Enter friendly name and click on Add Element.


B. From the recorder:



Do following steps to add element to element repository,


a. Go to recorder and search for required element in the DOM.

b. Right click on the DOM and select "Add to Element Repository", then friendly name pop-up will be populated

c. Enter friendly name and click on Add Element.




We can use this added elements to crate record test step(regular test step). As recorded test step is created from element repository element, the element will not be deleted when we delete recorded test step. By adding element explicitly, if any coded step interacted with this element doesn't causes test case failure. These type of elements should explicitly delete by us from element repository. In the auto generated meta data file (.tstest), you can find these type of elements under "IndependentDescriptors".






We can do required updates here, they will reflect on element repository.


The advantage of first approach is, we no need to worry about element repository clean up where as in second approach, we have to spend some time on element repository clean up if required. Anyhow, in both cases, if we delete test case then the elements bounded with that case will be deleted automatically from element repository.


 

No comments:

Post a Comment