/// <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); }
public bool AceitarTermoDeUso() { bool _result = false; try { util.WaitForElementVisible(CheckAceite, 10); if (CheckAceite.Displayed) { util.ScrollPage(2); if (CheckAceite.Selected == false) { CheckAceite.Click(); Thread.Sleep(750); } if (CheckAceite.Selected == true) { BtnSubmit.Click(); _result = true; } } } catch { } return(_result); }
public string LoginUserInvalidCredentials(string username, string password) { TxtUserName.SendKeys(username); TxtPassword.SendKeys(password); BtnSubmit.Click(); Thread.Sleep(5000); ErrorMessage = driver.FindElement(By.CssSelector(".alert.alert-danger")); return(ErrorMessage.Text); }
public string CreateGQ_FileUpload(DataRow dr) { Thread.Sleep(2000); BtnAddGlobalQuestion.Click(); RdoFileUpload.Click(); BtnSubmit.Click(); ManageGlobalQuestionPage mGQPage = new ManageGlobalQuestionPage(driver); return(mGQPage.CreateGQ_FileUpload(dr)); }
public void EditGQ_SelectMultipleitems(DataRow drAdd, DataRow drEdit) { Thread.Sleep(2000); BtnAddGlobalQuestion.Click(); RdoSelectMultipleItems.Click(); BtnSubmit.Click(); ManageGlobalQuestionPage mGQPage = new ManageGlobalQuestionPage(driver); mGQPage.EditGQ_SelectMultipleitems(drAdd, drEdit); }
public void EditGQ_FileUpload(DataRow drAdd, DataRow drEdit) { Thread.Sleep(2000); BtnAddGlobalQuestion.Click(); RdoFileUpload.Click(); BtnSubmit.Click(); ManageGlobalQuestionPage mGQPage = new ManageGlobalQuestionPage(driver); mGQPage.EditGQ_FileUpload(drAdd, drEdit); }
public void EditGQ_SingleLineTextBox(DataRow drAdd, DataRow drEdit) { Thread.Sleep(2000); BtnAddGlobalQuestion.Click(); RdoSingleLineTextBox.Click(); BtnSubmit.Click(); ManageGlobalQuestionPage mGQPage = new ManageGlobalQuestionPage(driver); mGQPage.EditGQ_SingleLineTextBox(drAdd, drEdit); }
public void EditGQ_MultiLineTextArea(DataRow drAdd, DataRow drEdit) { Thread.Sleep(2000); BtnAddGlobalQuestion.Click(); RdoMultiLineTextArea.Click(); BtnSubmit.Click(); ManageGlobalQuestionPage mGQPage = new ManageGlobalQuestionPage(driver); mGQPage.EditGQ_MultiLineTextArea(drAdd, drEdit); }
public string CreateGQ_SelectMultipleitems(DataRow dr) { Thread.Sleep(2000); BtnAddGlobalQuestion.Click(); RdoSelectMultipleItems.Click(); BtnSubmit.Click(); ManageGlobalQuestionPage mGQPage = new ManageGlobalQuestionPage(driver); return(mGQPage.CreateGQ_SelectMultipleitems(dr)); }
public string CreateGQ_MultiLineTextArea(DataRow dr) { Thread.Sleep(2000); BtnAddGlobalQuestion.Click(); RdoMultiLineTextArea.Click(); BtnSubmit.Click(); ManageGlobalQuestionPage mGQPage = new ManageGlobalQuestionPage(driver); return(mGQPage.CreateGQ_MultiLineTextArea(dr)); }
/// <summary> /// click submit button /// </summary> /// <returns></returns> public PropertyOwnerPage ClickSubmit() { while (!BtnSubmit.Displayed && BtnSubmit.Enabled) { Thread.Sleep(100); } BtnSubmit.Click(); while (!Driver.driver.Url.Contains("Home/Index")) { Thread.Sleep(100); } return(new PropertyOwnerPage()); }
public void submitItem() { try { Common.waitForElementIsPresent("First name field", "xpath", "//input[@id='wpsc_checkout_form_2']", Constants.TIME_OUT); BtnSubmit.Click(); ExReports.reportPass("'Purchase' button is clicked"); Common.checkTextIsPresent("Thank you, your purchase is pending"); } catch (Exception e) { ExReports.reportFail("Submit Item error" + e.Message); throw; } }
/// <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); }
public bool Submit() { bool _result = false; try { util.WaitForElementVisible(BtnSubmit, 45); if (BtnSubmit.Displayed) { BtnSubmit.Click(); //Thread.Sleep(3000); _result = true; } } catch { } return(_result); }
public bool ClicarEnviar() { bool _result = false; try { util.WaitForElementVisible(BtnSubmit, 10); if (BtnSubmit.Displayed && BtnSubmit.Enabled) { BtnSubmit.Click(); Thread.Sleep(2000); _result = true; } else { } } catch { } return(_result); }
/// <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); }
public void LoginUserValidCredentials(string username, string password) { TxtUserName.SendKeys(username); TxtPassword.SendKeys(password); BtnSubmit.Click(); }