Locked How to handle a data gridview using Coded ui

  • Wednesday, August 15, 2012 8:35 AM
     
     

    Hi All

    Acually I wanna handle datagrid view using Coded UI in descriptive mode of programming/coding,wherein I have to check the controls and components line by line of the gridview.Kindly send me the associated helpline.

    Regards

    DKNayak 


    DKNayak

All Replies

  • Thursday, August 16, 2012 9:27 AM
    Moderator
     
     

    Hi DKNayak,

    Thank you for posting in the MSDN forum.

    Not very sure which kind of app are you testing, but my suggestion is that you could try to record a coded UI test for your app with the Coded UI Test Builder, and then generate it to code, I think you could get more useful information, but if you want to Hand-coding a Coded UI Test, maybe you could check Mathew’s blog “Hand-coding a Coded UI Test”, hope it could provide useful information.

    Best Regards,


    Jack Zhai [MSFT]
    MSDN Community Support | Feedback to us

  • Friday, August 17, 2012 1:23 AM
     
     Answered Has Code

    Hi DKNayak,

    If you are working on a web application then the DataGrid is rendered as nothing but an Html table.

    You can create an HtmlTable object and assign the table's search properties to it.

    Then you can follow the below approach to iterate through each row and each cell:

    HtmlTable myTable = new HtmlTable(Container);//Container can be BrowserWindow object or any other UITestObject
    
    //add the search properties here
    
    foreach (Row row in myTable.Rows)
    {
      //do your row related stuff here
    
      foreach (Cell cell in row.Cells)
        {
          // do your cell related stuff here
        }
    }

    This is just an example code and haven't been written using the VSTS IDE, so please bear with any typos :-)

    Regards,

    Pankaj


    Utility to run CUIT Ordered Tests for multiple iterations (Now with automated result mailing) @ http://cuitbatchrunner.codeplex.com/

  • Saturday, August 18, 2012 6:38 PM
     
     

    Hi Pankaj

    Thank you for your support.Will you please let me know in details regarding the CUITBatchRunner.

    Regards


    DKNayak

  • Saturday, August 18, 2012 10:53 PM
     
     

    Hi DKNayak,

    Glad to hear back from you. CUITBatchRunner is a tool that you can use to run your orderedtests for multiple iterations for failed tests. The idea was to have something like we have in build files wherein we can include our tests to be run after the deployments and the failed tests can be re-executed to ensure that there are no false alarms (failures not due to bugs but due to problems like network latencies etc.)

    Although its nothing like build but in a similar way you can use this GUI based tool that provides you easy way to create suites from orderedtests and it will iterate the tests for the given number of iterations (re-iterates only for the failed tests). This is best suited for overnight runs wherein it will automatically check for any failures after an iteration is complete and will re-execute the failed tests only (the tests should be independent of each other). It also generates a snapshot result of the executed tests which can be exported to Html or Excel formats. You can also configure it to automatically send the results over mail if network is available.

    Note: It is a beta version and might still have bugs especially in results generation. Although everything works fine if used in the normal flow as mentioned in the documents.

    Regards,

    Pankaj


    Utility to run CUIT Ordered Tests for multiple iterations (Now with automated result mailing) @ http://cuitbatchrunner.codeplex.com/


    • Edited by pankaj.nith Saturday, August 18, 2012 10:55 PM
    •