CODED UI TESTING

May 17, 2013 at 9:36 AM
I use VS 2012 CUITe anyone can help me with this problems.

When I'm using IE9 there's no error but when I'm using Chrome and Firefox i always meet this problem.

Microsoft.VisualStudio.TestTools.UITest.Extension.UITestControlNotFoundException:Unable to fine the top level element of the control.

Microsoft.VisualStudio.TestTools.UITest.Extension.TechnologyNotSupportedException:The browser Firefox is currently not supported.

This is my code..
using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using System.Windows.Input;
using System.Windows.Forms;
using System.Drawing;
using Microsoft.VisualStudio.TestTools.UITesting;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Microsoft.VisualStudio.TestTools.UITest.Extension;
using Keyboard = Microsoft.VisualStudio.TestTools.UITesting.Keyboard;


namespace SampleTestInCBWEB
{
    /// <summary>
    /// Summary description for CodedUITest1
    /// </summary>
    [CodedUITest]
    public class CodedUITest1
    {
        public CodedUITest1()
        {
        }

       
        [TestMethod]
        [DataSource("Microsoft.VisualStudio.TestTools.DataSource.CSV", @"|DataDirectory|\BrowserData.csv", "BrowserData#csv", DataAccessMethod.Sequential)]
        public void CodedUITestMethod1()
        {
            BrowserWindow.CurrentBrowser = TestContext.DataRow[0].ToString();
            // To generate code for this test, select "Generate Code for Coded UI Test" from the shortcut menu and select one of the menu items.
            // For more information on generated code, see http://go.microsoft.com/fwlink/?LinkId=179463
            this.UIMap.RecordedMethod1();
            this.UIMap.AssertMethod1();
        }

        #region Additional test attributes

        // You can use the following additional attributes as you write your tests:

        ////Use TestInitialize to run code before running each test 
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{        
        //    // To generate code for this test, select "Generate Code for Coded UI Test" from the shortcut menu and select one of the menu items.
        //    // For more information on generated code, see http://go.microsoft.com/fwlink/?LinkId=179463
        //}

        ////Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{        
        //    // To generate code for this test, select "Generate Code for Coded UI Test" from the shortcut menu and select one of the menu items.
        //    // For more information on generated code, see http://go.microsoft.com/fwlink/?LinkId=179463
        //}

        #endregion

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }
        private TestContext testContextInstance;

        public UIMap UIMap
        {
            get
            {
                if ((this.map == null))
                {
                    this.map = new UIMap();
                }

                return this.map;
            }
        }

        private UIMap map;
    }
}
Coordinator
May 17, 2013 at 10:29 AM
Hi gbon03,

This discussion forum is for Coded UI Test enhanced Framework (CUITe).

For better help with Coded UI, you may refer to the Microsoft's "Test Tools in Visual Studio 2010 and 2012" discussion forum here.

Thank you.