NUnit -Data Driven Using Excel

2 posts, 0 answers
  1. Vidya
    Vidya avatar
    3 posts
    Member since:
    Jun 2013

    Posted 01 Jul 2013 Link to this post

    I am using ‘Telerik Test Framework’(NUnit Template) with VSTS 2012.

    Please help me how to do parameterization using Excel in ‘NUnit’ template. If you provide me step by step guide or Video will be great help.

    My Sample Code look like this:

    using System;

    using System.Collections.Generic;

    using System.Linq;

    using System.Text;

    using ArtOfTest.WebAii.Controls.HtmlControls;

    using ArtOfTest.WebAii.Controls.HtmlControls.HtmlAsserts;

    using ArtOfTest.WebAii.Core;

    using ArtOfTest.WebAii.ObjectModel;

    using ArtOfTest.WebAii.TestAttributes;

    using ArtOfTest.WebAii.TestTemplates;

    using NUnit.Framework;

    using Core = NUnit.Core;

    namespace UnitTestProject1{


    Public class TelerikNUnitTest1 : BaseTest



    Public void testmethod1()




     Find.ByXPath<HtmlInputText>("//input[@type='text' and contains(@name, 'EmailAddressTextBox')]").Text = "";

    Find.ById<HtmlInputPassword>("ctl00_ctl00_PageContentPlaceHolder_PageContentPlaceHolder_PasswordTextBox").Text = "Admin1";




    I wants to parameterized ‘Email Address’ and ‘Password’ field with multiple data

    My Excel sheet contains data like this

    EmailAddress Password Pwd123 pwd456

  2. Boyan Boev
    Boyan Boev avatar
    1072 posts

    Posted 01 Jul 2013 Link to this post

    Hi Vidya,

    If you are using the free Telerik Testing Framework and Visual Studio, you will need to follow their directions for creating a data driven test.

    If you are using Test Studio you need first to 
    Bind the test to an external data source and then write the code in a coded step:

    // You can reference the column by index
    Pages.Google.QText.Text = (string)Data[0];

    // Or by name
    Pages.Google.QText.Text = (string)Data["Numbers"];

    Hope this helps.

    Boyan Boev
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
Back to Top