/// <summary> /// Implements Dispose methode of IDisposable interface. /// </summary> public void Dispose() { this.objExecuteMSI = null; this.myWindow.Dispose(); this.myWindow = null; this.myControls = null; this.mauiWindow = null; this.mauiToolbar = null; this.mauiTextBox = null; this.mauiControl = null; this.messageIcon = null; }
/// <summary> /// This function explecitely close the FinishPage model dialogue. /// </summary> /// <param name="windowHandle">Window handle.</param> public void CloseModeldialogue(object windowHandle) { try { Thread.Sleep(4000); this.mauiWindow = this.myWindow.Get_WindowToSpecificControl((IntPtr)windowHandle, "AutomationId", "2355"); Maui.Core.WinControls.Control objExactControl = this.myControls.Get_MauiControl(this.mauiWindow); Logger.AddComment(MessagesBuildSanitySmokeToolBL.MsgRestartOptionModelFound, Logger.CommentType.Message); objExactControl.Click(); } catch (Exception) { return; } }
/// <summary> /// This function is for executing test case MsnInstall_NewUser_Medium_dontrestart. /// Test case Install Msn With New User taking Medium components and No Restart at the end. /// </summary> /// <param name="windowHandle">Window Handle.</param> /// <param name="connection">Connection string.</param> /// <param name="partner">Partner string.</param> /// <param name="language">Language string</param> /// <param name="accountDetails">List having details of user account</param> public void MsnInstallNewUserMediumDoNotRestart(IntPtr windowHandle, string connection, string partner, string language, List <string> accountDetails) { //// OS Version int majorOsVersion = System.Environment.OSVersion.Version.Major; try { ////Run the test for partner screen if the selected susii is of BC01 or Q001. if (partner == "BC01" || partner == "Q001") { this.myHtmlDoc = this.myWindow.Get_HtmlDocumentToWindow(windowHandle, "ClassName", "Internet Explorer_Server", "idButtonNext"); this.myHtmlButton = this.myControls.Get_HtmlButton(this.myHtmlDoc, "idButtonNext"); this.myHtmlButton.Click(); Logger.AddComment(MessagesBuildSanitySmokeToolBL.MsgPartnerScreenFound, Logger.CommentType.Message); } ////Select the option that user is connected to internet in case the susii is of ENUS, VZ01, Q001 or DELL. if (language == "ENUS" || language == "VZ01" || language == "Q001" || language == "DELL") { this.myHtmlDoc = this.myWindow.Get_HtmlDocumentToWindow(windowHandle, "ClassName", "Internet Explorer_Server", "optLan", true); if (this.myHtmlDoc.RawHtml.ToString().Contains("id=optLan")) { this.myHtmlButton = this.myControls.Get_HtmlButton(this.myHtmlDoc, "optLan"); this.myHtmlButton.Click(); this.myHtmlButton = this.myControls.Get_HtmlButton(this.myHtmlDoc, "idButtonNext"); while (this.myHtmlButton.IsDisabled) { Thread.Sleep(3000); } this.myHtmlButton.Click(); while (this.myHtmlButton.IsDisabled) { Thread.Sleep(3000); } } } ////Select the option for creating a new user in EnterEmailAddressScreen window. this.myHtmlDoc = this.myWindow.Get_HtmlDocumentToWindow(windowHandle, "ClassName", "Internet Explorer_Server", "idButtonNext"); if (partner != "Q002" && partner != "VZ02" && partner != "BC01") { this.myHtmlRadioButton = this.myControls.Get_HtmlRadioButton(this.myHtmlDoc, "optNew"); this.myHtmlRadioButton.Click(); } this.myHtmlButton = this.myControls.Get_HtmlButton(this.myHtmlDoc, "idButtonNext"); while (this.myHtmlButton.IsDisabled) { Thread.Sleep(3000); } Thread.Sleep(3000); Thread emailThread = new Thread(new ParameterizedThreadStart(this.CloseEmailModeldialogue)); emailThread.Start(windowHandle); this.myHtmlButton.Click(); Logger.AddComment(MessagesBuildSanitySmokeToolBL.MsgEnterEmailScreenFound, Logger.CommentType.Message); //// Select Dialup plan and goes through the ConfigureDialupNow window if the selected connection is Dialup. Thread.Sleep(20000); if (connection.ToLowerInvariant() == MessagesBuildSanitySmokeToolBL.DialUp) { this.myHtmlDoc = this.myWindow.Get_HtmlDocumentToWindow(windowHandle, "ClassName", "Internet Explorer_Server", "lbl_37B02038-553E-4691-AC3C-290EFE009E53"); this.myHtmlControl = this.myControls.Get_HtmlControl(this.myHtmlDoc, "lbl_37B02038-553E-4691-AC3C-290EFE009E53"); this.myHtmlControl.Click(); this.myHtmlButton = this.myControls.Get_HtmlButton(this.myHtmlDoc, "idButtonNext"); while (this.myHtmlButton.IsDisabled) { Thread.Sleep(3000); } this.myHtmlButton.Click(); Logger.AddComment(MessagesBuildSanitySmokeToolBL.MsgSelectMsnPlanWindowFound, Logger.CommentType.Message); this.myHtmlDoc = this.myWindow.Get_HtmlDocumentToWindow(windowHandle, "ClassName", "Internet Explorer_Server", "optLan"); this.myHtmlRadioButton = this.myControls.Get_HtmlRadioButton(this.myHtmlDoc, "optLan"); this.myHtmlRadioButton.Click(); this.myHtmlButton = this.myControls.Get_HtmlButton(this.myHtmlDoc, "idButtonNext"); this.myHtmlButton.Click(); Logger.AddComment(MessagesBuildSanitySmokeToolBL.MsgConfigureDialupScreenFound, Logger.CommentType.Message); } else { //// Select Premium Plan try { this.myHtmlDoc = this.myWindow.Get_HtmlDocumentToWindow(windowHandle, "ClassName", "Internet Explorer_Server", "lbl_DD248418-D8DA-4D11-BD71-0A0ABE8D763C"); this.myHtmlControl = this.myControls.Get_HtmlControl(this.myHtmlDoc, "lbl_DD248418-D8DA-4D11-BD71-0A0ABE8D763C"); this.myHtmlControl.Click(); this.myHtmlButton = this.myControls.Get_HtmlButton(this.myHtmlDoc, "idButtonNext"); while (this.myHtmlButton.IsDisabled) { Thread.Sleep(3000); } this.myHtmlButton.Click(); Logger.AddComment(MessagesBuildSanitySmokeToolBL.MsgSelectMsnPlanWindowFound, Logger.CommentType.Message); } catch (Exception) { ////do nothing } } ////Enter the user details in Create your e-mail address and password window. Thread.Sleep(10000); this.myHtmlDoc = this.myWindow.Get_HtmlDocumentToWindow(windowHandle, "ClassName", "Internet Explorer_Server", "FirstName"); this.myHtmlTextBox = this.myControls.Get_HtmlTextBox(this.myHtmlDoc, "FirstName"); this.myHtmlTextBox.Text = accountDetails[0]; this.myHtmlTextBox = this.myControls.Get_HtmlTextBox(this.myHtmlDoc, "LastName"); this.myHtmlTextBox.Text = accountDetails[1]; this.myHtmlTextBox = this.myControls.Get_HtmlTextBox(this.myHtmlDoc, "MemberName"); this.myHtmlTextBox.Text = accountDetails[2]; this.myHtmlTextBox = this.myControls.Get_HtmlTextBox(this.myHtmlDoc, "Password"); this.myHtmlTextBox.Text = accountDetails[3]; this.myHtmlTextBox = this.myControls.Get_HtmlTextBox(this.myHtmlDoc, "ConfirmedPassword"); this.myHtmlTextBox.Text = accountDetails[4]; this.myHtmlTextBox = this.myControls.Get_HtmlTextBox(this.myHtmlDoc, "SecretAnswer"); this.myHtmlTextBox.Text = accountDetails[5]; this.myHtmlSelectBox = this.myControls.Get_HtmlSelectBox(this.myHtmlDoc, "BirthDateMonth"); this.myHtmlSelectBox.SelectedIndex = Convert.ToInt32(accountDetails[6]); this.myHtmlSelectBox = this.myControls.Get_HtmlSelectBox(this.myHtmlDoc, "BirthDateDay"); this.myHtmlSelectBox.SelectedIndex = Convert.ToInt32(accountDetails[7]); this.myHtmlTextBox = this.myControls.Get_HtmlTextBox(this.myHtmlDoc, "BirthDateYear"); this.myHtmlTextBox.Text = accountDetails[8]; this.myHtmlButton = this.myControls.Get_HtmlButton(this.myHtmlDoc, "idButtonNext"); this.myHtmlButton.Click(); ////If the new user being created already exists, then take the first user from the choises given. while (this.myHtmlButton.IsDisabled) { Thread.Sleep(3000); } this.myHtmlDoc = this.myWindow.Get_HtmlDocumentToWindow(windowHandle, "ClassName", "Internet Explorer_Server", "suggestedNamesText", true); Thread.Sleep(10000); if (this.myHtmlDoc.RawHtml.ToString().Contains("suggestedNamesText")) { string strPage = this.myHtmlDoc.RawHtml.ToString(); int index = strPage.IndexOf("suggestedNamesText"); int inputIndex = strPage.IndexOf("INPUT", index); int tabIndex = strPage.IndexOf("tabIndex", index); string rbname = strPage.Substring(inputIndex + 9, (tabIndex - (inputIndex + 10))); this.myHtmlRadioButton = this.myControls.Get_HtmlRadioButton(this.myHtmlDoc, rbname); this.myHtmlRadioButton.Click(); this.myHtmlTextBox = this.myControls.Get_HtmlTextBox(this.myHtmlDoc, "Password"); this.myHtmlTextBox.Text = accountDetails[3]; this.myHtmlTextBox = this.myControls.Get_HtmlTextBox(this.myHtmlDoc, "ConfirmedPassword"); this.myHtmlTextBox.Text = accountDetails[4]; accountDetails[2] = rbname; this.myHtmlButton.Click(); Thread.Sleep(5000); } Logger.AddComment(MessagesBuildSanitySmokeToolBL.MsgCreteEmailAddScreenFound, Logger.CommentType.Message); ////Goes through Review_SignAgreement Window. this.myHtmlDoc = this.myWindow.Get_HtmlDocumentToWindow(windowHandle, "ClassName", "Internet Explorer_Server", "signatureName"); this.myHtmlControl = this.myControls.Get_HtmlControl(this.myHtmlDoc, "signatureName"); this.myHtmlTextBox = this.myControls.Get_HtmlTextBox(this.myHtmlDoc, "signature"); this.myHtmlTextBox.Text = this.myHtmlControl.InnerText; this.myHtmlButton = this.myControls.Get_HtmlButton(this.myHtmlDoc, "idButtonNext"); while (this.myHtmlButton.IsDisabled) { Thread.Sleep(3000); } this.myHtmlButton.Click(); Logger.AddComment(MessagesBuildSanitySmokeToolBL.MsgReviewSignAggScreenFound, Logger.CommentType.Message); ////Fills the credit card details in Provide your credit card information window. this.myHtmlDoc = this.myWindow.Get_HtmlDocumentToWindow(windowHandle, "ClassName", "Internet Explorer_Server", "CardType"); this.myHtmlSelectBox = this.myControls.Get_HtmlSelectBox(this.myHtmlDoc, "CardType"); this.myHtmlSelectBox.SelectedIndex = Convert.ToInt32(accountDetails[9]); this.myHtmlTextBox = this.myControls.Get_HtmlTextBox(this.myHtmlDoc, "AccountNumber"); this.myHtmlTextBox.Text = accountDetails[10]; this.myHtmlTextBox = this.myControls.Get_HtmlTextBox(this.myHtmlDoc, "CVV"); this.myHtmlTextBox.Text = accountDetails[11]; this.myHtmlSelectBox = this.myControls.Get_HtmlSelectBox(this.myHtmlDoc, "ExpirationMonth"); this.myHtmlSelectBox.SelectedIndex = Convert.ToInt32(accountDetails[12]); this.myHtmlSelectBox = this.myControls.Get_HtmlSelectBox(this.myHtmlDoc, "ExpirationYear"); this.myHtmlSelectBox.SelectedIndex = Convert.ToInt32(accountDetails[13]); this.myHtmlButton = this.myControls.Get_HtmlButton(this.myHtmlDoc, "idButtonNext"); this.myHtmlButton.Click(); Logger.AddComment(MessagesBuildSanitySmokeToolBL.MsgProvideCreditCardInfoWindowFound, Logger.CommentType.Message); ////Fills the billing address in Provide your billing address window. Thread.Sleep(10000); this.myHtmlDoc = this.myWindow.Get_HtmlDocumentToWindow(windowHandle, "ClassName", "Internet Explorer_Server", "Street1"); this.myHtmlTextBox = this.myControls.Get_HtmlTextBox(this.myHtmlDoc, "Street1"); this.myHtmlTextBox.Text = accountDetails[14]; this.myHtmlTextBox = this.myControls.Get_HtmlTextBox(this.myHtmlDoc, "City"); this.myHtmlTextBox.Text = accountDetails[15]; this.myHtmlTextBox = this.myControls.Get_HtmlTextBox(this.myHtmlDoc, "State"); this.myHtmlTextBox.Text = accountDetails[16]; this.myHtmlTextBox = this.myControls.Get_HtmlTextBox(this.myHtmlDoc, "PostalCode"); this.myHtmlTextBox.Text = accountDetails[17]; this.myHtmlTextBox = this.myControls.Get_HtmlTextBox(this.myHtmlDoc, "PhonePrefix"); this.myHtmlTextBox.Text = accountDetails[18]; this.myHtmlTextBox = this.myControls.Get_HtmlTextBox(this.myHtmlDoc, "PhoneNumber"); this.myHtmlTextBox.Text = accountDetails[19]; this.myHtmlButton = this.myControls.Get_HtmlButton(this.myHtmlDoc, "idButtonNext"); this.myHtmlButton.Click(); Logger.AddComment(MessagesBuildSanitySmokeToolBL.MsgProvideBillAddWindowFound, Logger.CommentType.Message); try { this.mauiWindow = this.myWindow.Get_WindowToSpecificControl(windowHandle, "AutomationId", "2354"); this.mauiControl = this.myControls.Get_MauiControl(this.mauiWindow); if (this.mauiControl != null) { this.mauiControl.Click(); throw new BuildSanityBusinessLogicException(BuildSanityBLExMessages.CreditCardNumberNotUnique); } } catch (BuildSanityBusinessLogicException bx) { Logger.AddComment(bx.Message, Logger.CommentType.Message); throw bx; } catch (Exception e) { //// Do Nothing } Thread.Sleep(10000); this.myHtmlDoc = this.myWindow.Get_HtmlDocumentToWindow(windowHandle, "ClassName", "Internet Explorer_Server", "idButtonNext"); this.myHtmlButton = this.myControls.Get_HtmlButton(this.myHtmlDoc, "idButtonNext"); while (this.myHtmlButton.IsDisabled) { Thread.Sleep(3000); } ////New user is created. this.myHtmlButton.Click(); Logger.AddComment(MessagesBuildSanitySmokeToolBL.MsgNewUserSignupCompWinFound, Logger.CommentType.Message); //// Select the type of Installation this.myHtmlDoc = this.myWindow.Get_HtmlDocumentToWindow(windowHandle, "ClassName", "Internet Explorer_Server", "optMinimum"); this.myHtmlRadioButton = this.myControls.Get_HtmlRadioButton(this.myHtmlDoc, "optMinimum"); this.myHtmlRadioButton.Click(); this.myHtmlButton = this.myControls.Get_HtmlButton(this.myHtmlDoc, "idButtonNext"); this.myHtmlButton.Click(); Logger.AddComment(MessagesBuildSanitySmokeToolBL.MsgCustomizeInstallationScreenFound, Logger.CommentType.Message); ////Installs Premium Client this.myHtmlDoc = this.myWindow.Get_HtmlDocumentToWindow(windowHandle, "ClassName", "Internet Explorer_Server", "idButtonNext"); this.myHtmlButton = this.myControls.Get_HtmlButton(this.myHtmlDoc, "idButtonNext"); this.myHtmlButton.Click(); Logger.AddComment(MessagesBuildSanitySmokeToolBL.MsgReadyToDownloadScreenFound, Logger.CommentType.Message); //// Finish page screen. this.myHtmlDoc = this.myWindow.Get_HtmlDocumentToWindow(windowHandle, "ClassName", "Internet Explorer_Server", Localization.Finish[Localization.LocalizationIndex].ToString()); Thread myThread = new Thread(new ParameterizedThreadStart(this.CloseModeldialogue)); myThread.Start(windowHandle); //// Next Button. this.myHtmlButton = this.myControls.Get_HtmlButton(this.myHtmlDoc, "idButtonNext"); while (this.myHtmlButton.IsDisabled) { Thread.Sleep(3000); } this.myHtmlButton.Click(); Logger.AddComment(MessagesBuildSanitySmokeToolBL.MsgFinishPageScreenFound, Logger.CommentType.Message); myThread.Join(); Logger.AddComment(MessagesBuildSanitySmokeToolBL.MsgSignUpSuccessful, Logger.CommentType.Pass); } catch (MitabaseException me) { Logger.AddComment(MessagesBuildSanitySmokeToolBL.MsgSignUpUnsuccessful, Logger.CommentType.Fail); #if debug throw new BuildSanityBusinessLogicException(BuildSanityBLExMessages.InstallationFailNewUser + Environment.NewLine + me.Message + Environment.NewLine + "InstallMsnExistingUserMediumDoNotRestart." + Environment.NewLine + "MitabaseException"); #endif throw new BuildSanityBusinessLogicException(BuildSanityBLExMessages.InstallationFailNewUser); } catch (Exception e) { Logger.AddComment(MessagesBuildSanitySmokeToolBL.MsgSignUpUnsuccessful, Logger.CommentType.Fail); #if debug throw new BuildSanityBusinessLogicException(BuildSanityBLExMessages.InstallationFailNewUser + Environment.NewLine + e.Message + Environment.NewLine + "InstallMsnExistingUserMediumDoNotRestart."); #endif throw new BuildSanityBusinessLogicException(BuildSanityBLExMessages.InstallationFailNewUser); } }