Cuite 4.5 framework is failing to find the control ....

Jul 22, 2014 at 7:27 AM
Hi,

Note: code is written for Gmail login screen

I have written piece of code in object repository for searching controls. Please any one take a look at the below code and help me in resolving the issue

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CUITe.Controls.HtmlControls;
using Microsoft.VisualStudio.TestTools.UITesting;


namespace cuite4._5.Object_Repository
{
public class PALogin : CUITe_BrowserWindow
{
    public new string sWindowTitle = "Sign in - Google Accounts";
    public CUITe_HtmlEdit txtEmail = new CUITe_HtmlEdit("Id=Email");
    public CUITe_HtmlPassword txtPasswd = new CUITe_HtmlPassword("Id=Passwd");
    public CUITe_HtmlInputButton btnSignIn = new CUITe_HtmlInputButton("Id=signIn");
}
}


and calling this controls in codedui test method



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;
using cuite4._5.Object_Repository;
using CUITe.Controls.HtmlControls;


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

    [TestMethod]
    public void CodedUITestMethod1()
    {
        BrowserWindow browser = CUITe_BrowserWindow.Launch("https://accounts.google.com");
        PALogin pgPALogin = CUITe_BrowserWindow.GetBrowserWindow<PALogin>();
        pgPALogin.txtEmail.SetText("Jimmy");
        pgPALogin.txtPasswd.SetText("Jimmypwd");
        pgPALogin.btnSignIn.Click();

    }
while execution it is launching the browser and after that failing in finding the controls

Exception message :


Test Name: CodedUITestMethod1
Test Outcome: Failed
Result Message:
Test method cuite4._5.CodedUITest1.CodedUITestMethod1 threw exception:
Microsoft.VisualStudio.TestTools.UITest.Extension.UITestControlNotFoundException: The playback failed to find the control with the given search properties. Additional Details:
TechnologyName: 'Web'
ControlType: 'Edit'
TagName: 'INPUT'
Id: 'Email'
Failed to find any control that matched the search condition Id='Email' && ControlType='Edit' ---> System.Runtime.InteropServices.COMException: Error HRESULT E_FAIL has been returned from a call to a COM component.


Thanks ,
Vineeta
Jul 25, 2014 at 7:20 PM
Came here to ask the same thing. Errors like this have been all over the place since switching to 2013
Aug 7, 2014 at 2:54 PM
Also getting the UITestControlNotFoundException on Hyperlinks that have a unique Id. Any ideas?