This is a migrated thread and some comments may be shown as answers.

Adding an element that already exists in the Elements repository should warn the user

3 Answers 46 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Ory
Top achievements
Rank 2
Ory asked on 30 Aug 2012, 09:21 AM
Hi,

I've noticed that when manually adding an element that already exists in the element repository (via hovering over > add Element) the element is added with no warning from Test Studio in regards to the element already being mapped.
I'm not sure if this is a new feature request, but I think it should warn the user, e.g.:  The Element is already related to element {CurrentElementName}. Are you sure you want to add a new element? OK\Cancel. 
If the user clicks OK then the normal dialog prompting for an element name should then be displayed otherwise the operation should be cancelled.

The lack of this feature has caused quite a few double mappings in our team due to a standard process of manually adding elements before using them (so that we can name them meaningfully), obviously before we realised that elements were added even if already there.

Regards,
Ory

3 Answers, 1 is accepted

Sort by
0
Cody
Telerik team
answered on 30 Aug 2012, 09:48 PM
Hello Ory,

If the elements truly are duplicates (on the same page, in the same iframe with the same find attributes) Test Studio will not add it as a duplicate. It will not warn you of this either. It will simply record the new test step and reference the already existing element.

I suspect what's really going on in your case is that Test Studio views the element being recorded is on a new/different page and recording this "duplicate" as a new element on a new page. We do this deliberately because even though the element could be a duplicate, if it's on a different page, we need to be on the safe side and record it as a different element on a different page compared to what's already been recorded.

To prevent this sort of duplication you need to change the page compare mode in the recording options. The default setting is "FullPathAndQuery". If your web application uses query strings heavily and the query strings do not bring up significantly different pages, Test Studio doesn't know this and will record all the elements from what it thinks are "different pages" (having different query strings) as different/unique elements. To us, the intelligent humans, we recognize them as duplicates. Unfortunately Test Studio isn't intelligent enough to know they are truly duplicates as opposed to similar looking elements on different pages of the web application.

When the web application behaves this way (uses query strings only for data and not to load different pages), a better setting is "FullPath". Then Test Studio will ignore the query string when comparing page nodes and will do a much better job automatically merging your elements together. You can also merge your already recorded elements by following this procedure.

If you have any follow up questions to this don't hesitate to ask.

Kind regards,
Cody
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Ory
Top achievements
Rank 2
answered on 06 Sep 2012, 09:58 AM
Hi Cody,

Thanks for the extensive reply!

I'm not sure you saw that I was referring to the command "Add Element" command from the hover menu? 
Was not referring to recording steps on elements that already exist (that is a separate problem...).

Please have a go at it and see if it happens in your environment.

Thanks!

Regards,
Ory
0
Cody
Telerik team
answered on 06 Sep 2012, 10:34 PM
Hi Ory,

Yes, that includes elements manually added via Add to Project: http://screencast.com/t/gCk4VgBd 

Kind regards,
Cody
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
Tags
General Discussions
Asked by
Ory
Top achievements
Rank 2
Answers by
Cody
Telerik team
Ory
Top achievements
Rank 2
Share this question
or