locked
Index was out of range. Must be non-negative and less than the size of the collection.

    Question

  •  

    My application works on a shopping  cart model.

    The administrator should be able to allocate products to various groups.

    On the allocation screen, the administrator should be able to assign and save the details of a resolver engineer.

    However when the script is played back., the HTTP request where the resolver details are saved throws an exception 
    The resolver details are not saved.
    Hence the product allocation fails.

     

    Therefore, the product cannot be requested in the shopping cart.

     

    The details are as follows:
    [ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
    Parameter name: index]
       System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource) +62
       System.ThrowHelper.ThrowArgumentOutOfRangeException() +12
       CitiGroup.VirtualSecurityRequest.App.Admin.ManageProductAllocation.btnOk_Click(Object sender, EventArgs e) in C:\VSS\001-Dev\074 - VSR 2.0\Prod\v2.3.2\CITIGROUP.VIRTUALSECURITYREQUEST.APP\Admin\ManageProductAllocation.aspx.cs:581
       System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
       System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107
       System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
       System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
       System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +174
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102
    • Moved by Syed Mehdi - MSFT Friday, November 07, 2008 5:57 PM Debugging web apps doesn't belong in Load Test Forum (Moved from Visual Studio Team System - Web and Load Testing to Web Development in Visual Studio)
    Tuesday, October 28, 2008 3:14 PM

All replies

  •  

    My application works on a shopping  cart model.

    The administrator should be able to allocate products to various groups.

    On the allocation screen, the administrator should be able to assign and save the details of a resolver engineer.

    However when the script is played back., the HTTP request where the resolver details are saved throws an exception 
    The resolver details are not saved.
    Hence the product allocation fails.

     

    Therefore, the product cannot be requested in the shopping cart.

     

    The details are as follows:
    [ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
    Parameter name: index]
       System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource) +62
       System.ThrowHelper.ThrowArgumentOutOfRangeException() +12
       CitiGroup.VirtualSecurityRequest.App.Admin.ManageProductAllocation.btnOk_Click(Object sender, EventArgs e) in C:\VSS\001-Dev\074 - VSR 2.0\Prod\v2.3.2\CITIGROUP.VIRTUALSECURITYREQUEST.APP\Admin\ManageProductAllocation.aspx.cs:581
       System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
       System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107
       System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
       System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
       System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +174
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102
    • Merged by Bill.Wang Thursday, October 30, 2008 7:21 AM The same question.
    Tuesday, October 28, 2008 3:33 PM
  • Sorry, but this forum is for VS Web & Load Testing and not general ASP.NET or Web Programming Questions.

    However, here are some things to try:

    • What is the value of index?
    • What is the size of the collection?
    • Have you tried placing a breakpoint before the line of code throwing the exception so you can examine the "state of things".  Please look at ASP.NET Debugging

     

    Tuesday, October 28, 2008 8:38 PM
  • Hi

    I am an automation tester. using VSTS 2008 Test edition.

    After the change in forum skins on 06 Oct 08, it has become impossible to log a thread against a particular group. The drop down list containing the names of the forums isnt wide enough to dipslay the full name. There are several forum names with same name Visual studio. Hence the users do not know which one to select !!

    The above exception was displayed when the automation script was replayed.

    Since I am a tester I wouldnt know the value of the index, size of collection etc.

    If my thread isnt in the right forum, could you please place this in the correct forum because of the technical issue I mentioned above.

    Thanks and Regards

    • Edited by a2162 Friday, October 31, 2008 3:53 PM
    Friday, October 31, 2008 3:52 PM