simond
simond

Reputation: 764

Coded Ui Playback failed to find given search control while running test in chrome browser

I am running coded ui test in Chrome browse.In Web application we have one link in grid and we have to click on that link. Same test is working fine in IE but in Chrome it is giving excpetion playback can not find control with technology name=MSAA and Control type=window

i have used below code:

if (ConfigurationManager.AppSettings["Driver"] == "IE")
{        
    BrowserWindow br = new BrowserWindow();
    HtmlHyperlink href1 = new HtmlHyperlink(br);
    href1.SearchProperties.Add
    (
        HtmlHyperlink.PropertyNames.InnerText,
        "link"
    );

    Mouse.Click(href1);

}
else
{

    BrowserWindow br = new BrowserWindow();

    string CT = br.ControlType.ToString();
    string Tn = br.TechnologyName.ToString();

    UITestControl Window = new UITestControl(br);
    Window.TechnologyName = "MSAA";
    Window.SearchProperties[UITestControl.PropertyNames.Name] = "link";
    Window.SearchProperties[UITestControl.PropertyNames.ClassName] = "standardURL";


    //link
    UITestControl link = new WinHyperlink(Window);

    link.SearchProperties[UITestControl.PropertyNames.ControlType] = "Window";

    Mouse.Click(link);
}

In IE execution that link is serchable and clickable with property innertext but in chrome it is not...also tried adding friendlyname but no luck..please suggest....Now i am in impression is like whether coded ui runs in chrome or not

Upvotes: 3

Views: 1044

Answers (1)

Carl Prothman
Carl Prothman

Reputation: 1551

You cannot record coded UI tests using Google Chrome or Mozilla Firefox browsers. To play back tests on non-IE web browsers, you must install the Selenium components for Coded UI Cross Browser Testing. https://msdn.microsoft.com/en-us/library/jj835758.aspx

Upvotes: 2

Related Questions