Unable to run script using Nunit

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

    Posted 25 Jun 2013 Link to this post

    Script is not executed when ‘Nunit’ item is added to ‘Unit Test Project’

    Please find below steps

    1. 1. I have created new project by selecting C# template i.e( Unit Test Project)
    2. 2. Deleted by default added ‘Class1.cs’ file
    3. 3. Installed Nunit in system
    4. 4. Added the new item to the project  i.e Nunit  (Visual C# Items->Test->TelerikTestingFramework2012.2->Web->Nunit)
    5. 5. Tried to add ‘NUnit Extension. dll’ file but didn’t find dll file link provided in ‘Telerik User guide’
    6. 6. Hence downloaded ‘NUnit Extension. dll’ from other sites and placed in ‘C:\Program Files (x86)\NUnit 2.6\bin\addins’ folder
    7. 7. But in ‘NUnit’ , Tools—‘Addins’, I didn’t find any addin
    8. 8. Right click on the sample script and clicked on ‘Run Test’

    9. Script is not at all executing  and not even browser is invoked

    Sample Script:

    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 ArtOfTest.WebAii.Win32.Dialogs;

    using ArtOfTest.WebAii.Silverlight;

    using ArtOfTest.WebAii.Silverlight.UI;

    using NUnit.Framework;

    using Core = NUnit.Core;

    //using Microsoft.VisualStudio.TestTools.UnitTesting;

    namespace Sampe1


        /// <summary>

        /// Summary description for TelerikNUnitTest1

        /// </summary>


        public class TelerikNUnitTest1 : BaseTest


            #region [Setup / TearDown]

            /// <summary>

            /// Initialization for each test.

            /// </summary>


            public void MyTestInitialize()


                #region WebAii Initialization

                Initialize(false, new TestContextWriteLine(Console.Out.WriteLine));






            public void MyTestCleanUp()


                #region WebAii CleanUp

                // Shuts down WebAii manager and closes all browsers currently running





            public void FixtureCleanup()






            public void SampleWebAiiTest()


                // Launch a browser instance


                // Navigate the active browser to www.wikipedia.org


                // Find the wikipedia search box and set it to "Telerik Test Studio";

                Find.ById<HtmlInputSearch>("searchInput").Text = "Telerik Test Studio";

                // Click the search arrow button


                // Validate that search contains 'Telerik Test Studio'

               // Assert.IsTrue(ActiveBrowser.ContainsText("Telerik Test Studio"));

                //Read more here:





    Please guide me how to run script using Nunit(Telerik Test Framework) in 'Unit Test Project'

  2. Velin Koychev
    Velin Koychev avatar
    88 posts

    Posted 26 Jun 2013 Link to this post

    Hello Vidya,

    You can try following the steps that are described in this article

    1) Add the new item to the project - NUnit  (Visual C# Items->Test->TelerikTestingFramework2012.2->Web->NUnit)
    2) Add references to the NUnit dll's nunit.core.dll and nunit.framework.dll
    3) If you have NUnit Test Adapter already installed, you should be now able to run the test successfully.

    I have recorded a short video to demonstrate you how to do this. 

    Regarding the NUnit Extension dll, you need to download the NUnit Extension source from here. You have to compile the sources against your version of NUnit, however you won't be able to do this if you use the most current NUnit version (2.6). The reason is that in the newer versions the  RunTestMethod(TestResult) is now private and cannot be overridden. You can try using an older version like 2.5.7 to make it work.
    You need to have this dll if you want to use Unit Testing Web Extensions. But you should be able to run sample test like this without any issue. 

    I hope this helps. 

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