How to access alert pop-up buttons?

Apr 28, 2012 at 2:26 AM

Hi automation folks,

I am new to CUITe and having a hard time trying to get the OK button to click in an alert pop-up. I've been able to get the innertext for the div but am lost from there on.

Would anybody like to give some info on how to do this or atleast where point me to where I find info. on how to figure this out?


Thanks in advance.

Apr 28, 2012 at 3:03 AM

Hi a_m_e,

I've just checked in some sample code to demonstrate this.

Changeset #16181


        public void Test_Value_As_SearchParameterKey()
            string baseDir = Path.GetDirectoryName(Assembly.GetAssembly(this.GetType()).CodeBase);
            CUITe_BrowserWindow bWin = CUITe_BrowserWindow.Launch(baseDir + "/TestHtmlPage.html", "A Test");
            bWin.Get<CUITe_HtmlInputButton>("Value=Log In").Click();

            UITestControl popup = new UITestControl(bWin);
            popup.TechnologyName = "MSAA";
            popup.SearchProperties.Add("ClassName", "#32770", "Name", "Message from webpage");
            UITestControl btnOK = new UITestControl(popup);
            btnOK.TechnologyName = "MSAA";
            btnOK.SearchProperties.Add("ControlType", "Button", "Name", "OK");


Sep 6, 2012 at 11:05 AM
Edited Sep 6, 2012 at 11:12 AM

There is actually an even easier way to click the OK button from a javascript alert window: