public void click() { IntPtr hid = handleid("msn"); //System.Threading.Thread.Sleep(2000); this.myHtmlDoc = this.cls.Get_HtmlDocumentToWindow(hid, "Name", "mstest_eses_1009"); Maui.Core.WinControls.Button objExactControl = this.c2.Get_MauiButton(this.myHtmlDoc); if (objExactControl.IsEnabled) { objExactControl.Click(); Thread.Sleep(2000); } try { this.myHtmlDoc = this.cls.Get_HtmlDocumentToWindow(hid, "AutomationId", "4019"); Maui.Core.WinControls.TextBox objExactControl4 = this.c2.Get_text(this.myHtmlDoc); } catch (Exception ex) { this.myHtmlDoc = this.cls.Get_HtmlDocumentToWindow(hid, "AutomationId", "5001"); Maui.Core.WinControls.Control objExactControl2 = this.c2.Get_MauiControl(this.myHtmlDoc); objExactControl2.Click(); this.click(); } }
/// <summary> /// This function is for finding the user from user list and click the same. /// </summary> /// <param name="handleID">Handle to the given UI object.</param> /// <param name="uiProperty">UI object property.</param> /// <param name="uiValue">UI object property value.</param> /// <param name="requiredProcessName">Required process name.</param> /// <param name="count">Number of itteration.</param> public void SearchAndClickUser(IntPtr handleID, string uiProperty, string uiValue, string requiredProcessName, ref int count) { try { if (count > 5) { return; } ++count; //// Find the user button. this.mauiWindow = this.myWindow.Get_WindowToSpecificControl(handleID, uiProperty, uiValue); this.myMauiCoreButton = this.myControls.Get_MauiButton(this.mauiWindow); if (this.myMauiCoreButton.IsEnabled) { //// Click the searched button. this.myMauiCoreButton.Click(); } try { Thread.Sleep(2000); handleID = this.objExecuteMSI.Get_WindowHandle(requiredProcessName); //// Password testbox. this.mauiWindow = this.myWindow.Get_WindowToSpecificControl(handleID, "AutomationId", "4019"); } catch (Exception) { //// Scroll down button this.mauiWindow = this.myWindow.Get_WindowToSpecificControl(handleID, "AutomationId", "5001"); this.myMauiCoreButton = this.myControls.Get_MauiButton(this.mauiWindow); this.myMauiCoreButton.Click(); this.SearchAndClickUser(handleID, uiProperty, uiValue, requiredProcessName, ref count); } } catch (MitabaseException me) { #if debug throw new BuildSanityBusinessLogicException(me.Message + Environment.NewLine + "ExistingUserSignIn." + Environment.NewLine + "MitabaseException"); #endif throw new BuildSanityBusinessLogicException(me.Message); } catch (Exception e) { #if debug throw new BuildSanityBusinessLogicException(e.Message + Environment.NewLine + e.Message + Environment.NewLine + "ExistingUserSignIn."); #endif throw new BuildSanityBusinessLogicException(e.Message); } }
/// <summary> /// Implements Dispose methode of IDisposable interface. /// </summary> public void Dispose() { this.myWindow.Dispose(); this.myWindow = null; this.objQuickBrowserSignin.Dispose(); this.objQuickBrowserSignin = null; this.myControls = null; this.objExecuteMSI = null; this.mauiWindow = null; this.myMauiCoreControl = null; this.myMauiCoreTextBox = null; this.myMauiCoreButton = null; this.mauiControl = null; }