Wednesday, January 9, 2019

[Coded UI] find matching control for wintabpage



           BrowserWindow br = new BrowserWindow();

            WinTabPage page = new WinTabPage(br);

            MessageBox.Show(page.FindMatchingControls().Count.ToString());

            foreach (WinTabPage pg in page.FindMatchingControls())
            {
                MessageBox.Show(pg.FriendlyName.ToString());
                Console.WriteLine(pg.FriendlyName.ToString());
            }



If the browser window is not specified, it finds a lot of tabs including VS, and every opened apps.

No comments:

Post a Comment