This is a migrated thread and some comments may be shown as answers.

Test with coded step throws compilation error

2 Answers 146 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Svetlana
Top achievements
Rank 1
Svetlana asked on 01 Jun 2010, 12:52 PM
Hi,

I'm using Telerik WebUI Test Studio 2010.1
I've recorded simple test and added a coded step.

On attempt to run the test I get the following compilation error:
c:\Users\userName\Documents\WebUI Test Studio Projects\TestProject1\New Test.aii.cs: Line 1: (CS0246) The type or namespace name 'Telerik' could not be found (are you missing a using directive or an assembly reference?)
c:\Users\userName\Documents\WebUI Test Studio Projects\TestProject1\New Test.aii.cs: Line 2: (CS0246) The type or namespace name 'Telerik' could not be found (are you missing a using directive or an assembly reference?)

Test code is as follows:

"using Telerik.WebAii.Controls.Html;
using Telerik.WebAii.Controls.Xaml;
using System;
using System.Collections.Generic;
using System.Text;

using ArtOfTest.Common.UnitTesting;
using ArtOfTest.WebAii.Core;
using ArtOfTest.WebAii.Controls.HtmlControls;
using ArtOfTest.WebAii.Controls.HtmlControls.HtmlAsserts;
using ArtOfTest.WebAii.Design;
using ArtOfTest.WebAii.Design.Execution;
using ArtOfTest.WebAii.ObjectModel;
using ArtOfTest.WebAii.Silverlight;
using ArtOfTest.WebAii.Silverlight.UI;

namespace TestProject1
{

    //
    // You can add custom execution steps by simply
    // adding a void function and decorating it with the [CodedStep]
    // attribute to the test method.
    // Those steps will automatically show up in the test steps on save.
    //
    // The BaseWebAiiTest exposes all key objects that you can use
    // to access the current testcase context. [i.e. ActiveBrowser, Find ..etc]
    //
    // Data driven tests can use the Data[columnIndex] or Data["columnName"]
    // to access data for a specific data iteration.
    //
    // Example:
    //
    // [CodedStep("MyCustom Step Description")]
    // public void MyCustomStep()
    // {
    //        // Custom code goes here
    //      ActiveBrowser.NavigateTo("http://www.google.com");
    //
    //        // Or
    //        ActiveBrowser.NavigateTo(Data["url"]);
    // }
    //
        

    public class New_Test : BaseWebAiiTest
    {
        #region [ Dynamic Pages Reference ]

        private Pages _pages;

        /// <summary>
        /// Gets the Pages object that has references
        /// to all the elements, frames or regions
        /// in this project.
        /// </summary>
        public Pages Pages
        {
            get
            {
                if (_pages == null)
                {
                    _pages = new Pages(Manager.Current);
                }
                return _pages;
            }
        }

        #endregion
        
        // Add your test methods here...
    
        [CodedStep(@"New Coded Step")]
        public void New_Test_CodedStep()
        {
            ActiveBrowser.Manager.AddNewBrowser();
            ActiveBrowser.NavigateTo("http://www.google.com/");
        }
    }
}

Could you, please, tell me what is wrong?

2 Answers, 1 is accepted

Sort by
0
Nikolai
Telerik team
answered on 01 Jun 2010, 02:10 PM
Hello Svetlana Sazonova,

 
As far as I see from the code you send, you seems to be having one additional quotation mark in front of - "using Telerik.WebAii.Controls.Html; which is causing the complier to throw and error.

Can you please remove it and try again?

Regards,
Nikolai
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Eliza
Top achievements
Rank 1
answered on 14 Apr 2011, 10:04 AM
1
Tags
General Discussions
Asked by
Svetlana
Top achievements
Rank 1
Answers by
Nikolai
Telerik team
Eliza
Top achievements
Rank 1
Share this question
or