Unexpected error thrown while setting the dropdown

4 posts, 0 answers
  1. Nick
    Nick avatar
    19 posts
    Member since:
    Feb 2014

    Posted 11 May 2015 Link to this post

    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

  2. Ivaylo
    Admin
    Ivaylo avatar
    750 posts

    Posted 14 May 2015 Link to this post

    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!
  3. Nick
    Nick avatar
    19 posts
    Member since:
    Feb 2014

    Posted 14 May 2015 in reply to Ivaylo Link to this post

    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

  4. Ivaylo
    Admin
    Ivaylo avatar
    750 posts

    Posted 18 May 2015 Link to this post

    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!
Back to Top