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

An item with the same key has already been added.

3 Answers 581 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Dex
Top achievements
Rank 1
Dex asked on 21 Feb 2017, 09:31 AM

Hi there,

This issue is currently starting across a lot of my tests. Some tests are data driven, but most are just standard recorded steps, with maybe 1 or 2 very basic coded steps. Does anyone have any idea on how to stop this from happening?

Im current recording a test, and it breaks with the exception below. I disable that step, then it breaks with the same exception on the step below the disabled step.

Failure Information: 
~~~~~~~~~~~~~~~
Exception thrown while finding elements for the following descriptor 'Verify element 'DepositIcon' 'is' visible.'. Exception 'System.ArgumentException: An item with the same key has already been added.
   at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at ArtOfTest.WebAii.Design.Execution.ExecutionUtils.FindTargets(IAutomationHost targetHost, AutomationDescriptor baseDescriptor)'Learn more about finding elements here:
http://docs.telerik.com/teststudio/troubleshooting-guide/test-execution-problems-tg/unable-to-locate-element

Im using Test Studio version 2016.3.928.0.

Any assistance will be greatly appreciated.

Thanks

David

3 Answers, 1 is accepted

Sort by
0
Elena
Telerik team
answered on 23 Feb 2017, 03:10 PM
Hi David,

Thank you for your detailed description. 

I was unable to reproduce the same behavior and therefore would like to ask you for exact steps to replicate the issue. Do you observe this behavior against a particular application or you could replicate it against a public accessible one?

Usually once an element is recorded then it is reused for every other step against the same element. Do you observe the crash while recording? Are you able to continue working or you need to restart the application? 

Could you please also generate the application log during repeating the crash? Please clear the log prior that to ensure only relative to the current issue records are stored within. 

Thanks in advance for your cooperation! 

Regards,
Elena Tsvetkova
Telerik by Progress
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Dex
Top achievements
Rank 1
answered on 24 Feb 2017, 08:53 AM
Hi Elena,

Thank you for the reply.

I’m sorry, I should have been more specific in my post. It wasn’t happening during recording, but during play back. Whether I use ‘Execute Test’ or ‘Play to here’, only then do I get the error. This appears to happen more often in Chrome, and sometimes in IE.

If I select ‘Execute Test’ in Chrome, with the step disabled, the same error appears, just with a different element name. So I am unable to see if it’s a particular element.

Unfortunately, if I clear the logs and run the test, I get the exact same error, with no further details. The application I am currently testing in not accessible to the outside yet, so I am unable to send any links.

While I was recording the test with Chrome, I did get a few errors, something like ‘Something has gone wrong’ and 3 buttons, ‘Save’, ‘Save and close’ and  ‘Report’. (I think) At this point I swapped over to IE which seemed a bit more stable for recording.

Could it be that maybe 2 elements may have been added to the dictionary with the same key, causing the issue? Do you think I should re-record the full test again? (Hopefully not get any errors)

Sorry I can’t provide you with much more information. But your feedback is appreciated.

Thank you

David
0
Elena
Telerik team
answered on 01 Mar 2017, 08:39 AM
Hi David,

Thanks for all shared details. 

From what you describe something went definitely wrong. Though without the crash details from the log I am unable to determine what it could be. If this happens in a single test I would like to ask you to delete it and re-record the test. In case a crash appears again, please collect the log file and provide it here. 

Thanks! 

Regards,
Elena Tsvetkova
Telerik by Progress
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
Tags
General Discussions
Asked by
Dex
Top achievements
Rank 1
Answers by
Elena
Telerik team
Dex
Top achievements
Rank 1
Share this question
or