locked
How to add test data in Excel RRS feed

  • Question

  • I am using data driven test with MSTEST and Excel.

    I have added complex objects in xml format (serialized) in excel sheet.

    Using deserialization I am creating the objects.

    But the problem is editing the serialized data (too much hectic to edit it)

    Is there any other way to specify complex objects in Excel?

     


    Regards,
    Jaydeep
    Thursday, February 3, 2011 8:24 AM

Answers

  • Hello  Jaydeep,

    Welcome to the MSDN forum. My name is Shane Hu.

    As you said before, you want to have good method to make your job conveniently, I have some ideas about it, it is as follows:

    1.      You are doing a Data-driven test now. You can refer to this website below: http://msdn.microsoft.com/en-us/library/ms182527.aspx. As far as my experience, there are many kinds of  data source to support data-driven test. Such as SQL server, Access, file, etc.

    2.      If the object has the same character, you can make a file(.txt), every row in which is organized regularly and every element in every row is arranged regularly, such as:

    name,male,198803,

    name,felmale,198006

    ……

    Also you can make them stored in SQL server, access, etc. So, you just maintain the data source after you doing this.

    3.      You can create a solution in Visual Studio to generate the XML from the file or database to make conversion be automatically.

    4.      So, after converting to  XML, as you said before, you should modify your program about serialization and deserialization more common.

    I hope these idea can help you resolve your issue. If you still have some confusion, please let me know at once.

    Best regards,

    Shane


    Hualiang Hu [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, February 7, 2011 6:24 AM
    Moderator

All replies

  • Hi,

    You could use an xml data source instead of excel which might be simpler. Refer http://codeclimber.net.nz/archive/2008/01/18/How-to-simulate-RowTest-with-MS-Test.aspx

    Thanks,

    Anuj

    Thursday, February 3, 2011 7:12 PM
  • Hello  Jaydeep,

    Welcome to the MSDN forum. My name is Shane Hu.

    As you said before, you want to have good method to make your job conveniently, I have some ideas about it, it is as follows:

    1.      You are doing a Data-driven test now. You can refer to this website below: http://msdn.microsoft.com/en-us/library/ms182527.aspx. As far as my experience, there are many kinds of  data source to support data-driven test. Such as SQL server, Access, file, etc.

    2.      If the object has the same character, you can make a file(.txt), every row in which is organized regularly and every element in every row is arranged regularly, such as:

    name,male,198803,

    name,felmale,198006

    ……

    Also you can make them stored in SQL server, access, etc. So, you just maintain the data source after you doing this.

    3.      You can create a solution in Visual Studio to generate the XML from the file or database to make conversion be automatically.

    4.      So, after converting to  XML, as you said before, you should modify your program about serialization and deserialization more common.

    I hope these idea can help you resolve your issue. If you still have some confusion, please let me know at once.

    Best regards,

    Shane


    Hualiang Hu [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, February 7, 2011 6:24 AM
    Moderator
  • Hi Jaydeep,

    Is this issue fixed? Please let me know at once.

    Best regards,

    Shane


    Hualiang Hu [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, February 9, 2011 2:40 AM
    Moderator
  • Hi All,

     

    I have always used the excel for all the test where I am testing large data for same field and or for many fields in the same web test and it works very well for me. The only issue is if I have to change my data in the excel , i have to re deploy the excel to the web test. This is one of the limitation which I have noticed.

    IF any one has any other view please let me know so that even I can try different method to do the data testing for the same web test.

    Regards,

    Arjun

    Tuesday, April 5, 2011 12:49 PM