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

Unexpected error thrown while setting the dropdown

3 Answers 91 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Nick
Top achievements
Rank 1
Nick asked on 11 May 2015, 05:18 PM

Hi,

Please help me out on this, I'm running a data driven test which encounters this error on a drop down step. I'm pretty sure that I have recorded the steps correctly. But for some reason this error keeps on popping on several iterations.

Failure Information:
~~~~~~~~~~~~~~~
ExecuteCommand failed!
InError set by the client. Client Error:
System.ApplicationException: Unexpected error thrown while setting the dropdown ---> System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: DropDown was unable to find the item '3' in the dropdown requested. DropDown had the following values only:
 
   at ArtOfTest.InternetExplorer.IECommandProcessor.SelectDropDown(IHTMLElement target, Int32 index, String text, Boolean useValue)
   --- End of inner exception stack trace ---
   at ArtOfTest.InternetExplorer.IECommandProcessor.SelectDropDown(IHTMLElement target, Int32 index, String text, Boolean useValue)
   at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessActionCommands(BrowserCommand request)
   at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessCommand(WebBrowserClass ieInstance, BrowserCommand request, IHTMLDocument2 document)
BrowserCommand (Type:'Action',Info:'NotSet',Action:'SelectDropDown',Target:'ElementId (tagName: 'select',occurrenceIndex: '6')',Data:'V:3',ClientId:'Client_968eb438-6eb9-48bb-9876-4b8a276abfb7',HasFrames:'False',FramesInfo:'',TargetFrameIndex:'-1',InError:'True',Response:'System.ApplicationException: Unexpected error thrown while setting the dropdown ---> System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: DropDown was unable to find the item '3' in the dropdown requested. DropDown had the following values only:
 
   at ArtOfTest.InternetExplorer.IECommandProcessor.SelectDropDown(IHTMLElement target, Int32 index, String text, Boolean useValue)
   --- End of inner exception stack trace ---
   at ArtOfTest.InternetExplorer.IECommandProcessor.SelectDropDown(IHTMLElement target, Int32 index, String text, Boolean useValue)
   at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessActionCommands(BrowserCommand request)
   at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessCommand(WebBrowserClass ieInstance, BrowserCommand request, IHTMLDocument2 document)')
InnerException: none.

InnerException:
ArtOfTest.WebAii.Exceptions.ExecuteCommandException: ExecuteCommand failed!
InError set by the client. Client Error:
System.ApplicationException: Unexpected error thrown while setting the dropdown ---> System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: DropDown was unable to find the item '3' in the dropdown requested. DropDown had the following values only:
 
   at ArtOfTest.InternetExplorer.IECommandProcessor.SelectDropDown(IHTMLElement target, Int32 index, String text, Boolean useValue)
   --- End of inner exception stack trace ---
   at ArtOfTest.InternetExplorer.IECommandProcessor.SelectDropDown(IHTMLElement target, Int32 index, String text, Boolean useValue)
   at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessActionCommands(BrowserCommand request)
   at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessCommand(WebBrowserClass ieInstance, BrowserCommand request, IHTMLDocument2 document)
BrowserCommand (Type:'Action',Info:'NotSet',Action:'SelectDropDown',Target:'ElementId (tagName: 'select',occurrenceIndex: '6')',Data:'V:3',ClientId:'Client_968eb438-6eb9-48bb-9876-4b8a276abfb7',HasFrames:'False',FramesInfo:'',TargetFrameIndex:'-1',InError:'True',Response:'System.ApplicationException: Unexpected error thrown while setting the dropdown ---> System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: DropDown was unable to find the item '3' in the dropdown requested. DropDown had the following values only:
 
   at ArtOfTest.InternetExplorer.IECommandProcessor.SelectDropDown(IHTMLElement target, Int32 index, String text, Boolean useValue)
   --- End of inner exception stack trace ---
   at ArtOfTest.InternetExplorer.IECommandProcessor.SelectDropDown(IHTMLElement target, Int32 index, String text, Boolean useValue)
   at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessActionCommands(BrowserCommand request)
   at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessCommand(WebBrowserClass ieInstance, BrowserCommand request, IHTMLDocument2 document)')
InnerException: none.

 I've tried the selection through Text, Values and Index already but there are iterations which are still being failed.

Birth Region field will only be available once Country of birth is selected, the same can be said on the birth district field. (see attached vid)

I have placed a script step prior to the selection step to help find the element though it has helped significantly as it has not failed most of the data driven test there are still iterations which are failing.

https://www.dropbox.com/s/7mj8sas72n0acsp/trips_05112015.swf?dl=0

3 Answers, 1 is accepted

Sort by
0
Ivaylo
Telerik team
answered on 14 May 2015, 11:20 AM
Hello Niccolo,

From the video nothing is clear what exactly is failing. It is a good practice to set the AjaxTimeout to select dropdown steps, since usually they require some time until the content is refreshed. Please check the attached file for more clarity.

If this does not help it will be helpful to provide the test so we can give it a try on our end and investigate further.

Regards,
Ivaylo
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Nick
Top achievements
Rank 1
answered on 14 May 2015, 11:30 AM

Hi Ivaylo

the error is encountered on several iterations during a data driven test. the video posted is just a reference as to where the error happens.

on an average about 5-7 iterations are failing out of 50. will run the test again with your suggestion and provide some feed back if it works

0
Ivaylo
Telerik team
answered on 18 May 2015, 12:31 PM
Hello Niccolo,

Hope the solution provided will work for you.

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