/// <summary> /// To Create Select Multiple Items from a List Global Question /// </summary> public string CreateGQ_Date(DataRow dr) { if (dr != null) { reference = dr["Reference"].ToString() + "_" + DateTime.Now.ToString().Replace(' ', '_').Replace(':', '_').Replace('/', '_'); TxtReference.Clear(); TxtReference.SendKeys(reference); if (dr["Active"].ToString().ToLower() == "yes") { RdoActiveYes.Click(); } else { RdoActiveNo.Click(); } TxtLabel(dr["Label"].ToString()); if (dr["Required"].ToString().ToLower() == "yes") { RdoRequiredYes.Click(); } else { RdoRequiredNo.Click(); } BaseMethods.DdlSelectByText(DdlAnswerFormat, dr["AnswerFormat"].ToString()); BtnSubmit.Click(); Thread.Sleep(2000); Assert.IsTrue(SuccessMessage.Displayed, reference + " - Date Global Question is not " + formSubmitType + " successfully"); ExtentReport.test.Log(LogStatus.Pass, "Success Message is displayed, " + reference + " - Date Global Question " + formSubmitType + " successfully"); } return(reference); }
/// <summary> /// To Create Multi Line Text Area Global Question /// </summary> public string CreateGQ_MultiLineTextArea(DataRow dr) { if (dr != null) { reference = dr["Reference"].ToString() + "_" + DateTime.Now.ToString().Replace(' ', '_').Replace(':', '_').Replace('/', '_'); TxtReference.Clear(); TxtReference.SendKeys(reference); if (dr["Active"].ToString().ToLower() == "yes") { RdoActiveYes.Click(); } else { RdoActiveNo.Click(); } TxtLabel(dr["Label"].ToString()); if (dr["Required"].ToString().ToLower() == "yes") { RdoRequiredYes.Click(); } else { RdoRequiredNo.Click(); } TxtMaxLength.Clear(); TxtMaxLength.SendKeys(dr["MaxLength"].ToString()); if (dr["MaxLenghtType"].ToString().ToLower() == "characters") { RdoCharacters.Click(); } else { RdoWords.Click(); } BtnSubmit.Click(); Thread.Sleep(2000); Assert.IsTrue(SuccessMessage.Displayed, reference + " - Multi Line Text Area Global Question is not " + formSubmitType + " successfully"); ExtentReport.test.Log(LogStatus.Pass, "Success Message is displayed, " + reference + " - Multi Line Text Area Global Question " + formSubmitType + " successfully"); } return(reference); }
/// <summary> /// To Create Select Multiple Items from a List Global Question /// </summary> public string CreateGQ_SelectMultipleitems(DataRow dr) { if (dr != null) { reference = dr["Reference"].ToString() + "_" + DateTime.Now.ToString().Replace(' ', '_').Replace(':', '_').Replace('/', '_'); TxtReference.Clear(); TxtReference.SendKeys(reference); if (dr["Active"].ToString().ToLower() == "yes") { RdoActiveYes.Click(); } else { RdoActiveNo.Click(); } TxtLabel(dr["Label"].ToString()); if (dr["Required"].ToString().ToLower() == "yes") { RdoRequiredYes.Click(); } else { RdoRequiredNo.Click(); } BaseMethods.DdlSelectByText(DdlAnswerFormat, dr["AnswerFormat"].ToString()); BtnSubmit.Click(); Thread.Sleep(2000); Assert.IsTrue(SuccessMessage.Displayed, reference + " - Select Multiple Items from a List Global Question is not " + formSubmitType + " successfully"); ExtentReport.test.Log(LogStatus.Pass, "Success Message is displayed, " + reference + " - Select Multiple Items from a List Global Question " + formSubmitType + " successfully"); if (dr["Options"].ToString().Trim() != string.Empty) { OptionTab.Click(); if (formSubmitType == "created") { #region Adding Answer Options AddOptionButton.Click(); string[] OptionsList = dr["Options"].ToString().Trim().Split(','); for (int i = 0; i < OptionsList.Length; i++) { AnswerOptionsTextBox.SendKeys(OptionsList[i].Trim() + "\r\n"); } BtnSubmit.Click(); Thread.Sleep(2000); Assert.IsTrue(SuccessMessage.Displayed, "Answer Options for the Global Question " + reference + " is not created successfully"); ExtentReport.test.Log(LogStatus.Pass, "Answer Options for the Global Question " + reference + " is created successfully"); #endregion #region Answer Options Moving Up and Down if (OptionsList.Length > 1) { AnswerOption_MoveUp.Click(); ExtentReport.test.Log(LogStatus.Pass, "Answer Options for the Global Question " + reference + " has been moved up successfully"); Thread.Sleep(2000); AnswerOption_MoveDown.Click(); ExtentReport.test.Log(LogStatus.Pass, "Answer Options for the Global Question " + reference + " has been moved down successfully"); } #endregion #region Making Answer Option InActive Thread.Sleep(2000); AnswerOption_Edit.Click(); RdoActiveNo.Click(); BtnSubmit.Click(); Thread.Sleep(2000); Assert.IsTrue(SuccessMessage.Displayed, "Making " + OptionsList[0].Trim() + " - Answer Option InActive was unsuccessfully"); ExtentReport.test.Log(LogStatus.Pass, OptionsList[0].Trim() + " - Answer Option has been made InActive successfully"); #endregion } else { string optionNameBefore = AnswerOption_Name.Text; Thread.Sleep(2000); AnswerOption_Edit.Click(); AnswerOption_NameTxtBx.Clear(); AnswerOption_NameTxtBx.SendKeys(dr["Options"].ToString()); RdoActiveNo.Click(); BtnSubmit.Click(); Assert.AreEqual(dr["Options"].ToString(), AnswerOption_Name.Text, "Answer Options for the Global Question is not edited successfully"); ExtentReport.test.Log(LogStatus.Pass, optionNameBefore + " has been successfully edited to " + AnswerOption_Name.Text + " and made InActive"); } } } return(reference); }