Coded Ui Playback could not find the given control when running the test in the Chrome browser

I am running coded ui test in chrome browser. In the web app, we have one link in the grid and we have to click on that link. The same test works fine in IE, but in Chrome it gives reproduction excpetion cannot find control with technology name = MSAA and Control type = window

I 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 doing this link isAGEable and clickable using innertext property, but in chrome it is not ... also tried to add friendly name but no luck..please suggest .... Now I am impressed how the coded ui works in chrome or not

+3


source to share


1 answer


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



+2


source







All Articles