public void languageNameValidation() { string[] username = null; string[] password = null; string[] log = null; var oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); username = oXMLData.getData("settings/Credentials", "username_corp"); password = oXMLData.getData("settings/Credentials", "password"); log = oXMLData.getData("settings/URL", "logout"); // Initializing the objects var executionLog = new ExecutionLog(); var loginHelper = new LoginHelper(GetWebDriver()); var corpMasterdata_LanguageHelper = new CorpMasterdata_LanguageHelper(GetWebDriver()); String JIRA = ""; String Status = "Pass"; var Lang = "Eng" + GetRandomNumber(); try { executionLog.Log("LanguageNameValidation", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("LanguageNameValidation", "Verify Page title"); VerifyTitle("Dashboard"); executionLog.Log("LanguageNameValidation", "Go to Language page"); VisitCorp("languages"); executionLog.Log("LanguageNameValidation", "Verify title"); VerifyTitle("Languages"); executionLog.Log("LanguageNameValidation", "Click on 'Create' button"); corpMasterdata_LanguageHelper.ClickForce("Create"); corpMasterdata_LanguageHelper.WaitForWorkAround(2000); executionLog.Log("LanguageNameValidation", "Wait for text"); corpMasterdata_LanguageHelper.WaitForText("Add New Language", 10); corpMasterdata_LanguageHelper.WaitForWorkAround(4000); executionLog.Log("LanguageNameValidation", "Enter language name"); corpMasterdata_LanguageHelper.TypeText("Language", Lang); corpMasterdata_LanguageHelper.WaitForWorkAround(4000); executionLog.Log("LanguageNameValidation", "Click on Save button"); corpMasterdata_LanguageHelper.ClickForce("Save"); executionLog.Log("LanguageNameValidation", "Wait for text"); corpMasterdata_LanguageHelper.WaitForText("Language Created Successfully", 10); executionLog.Log("LanguageNameValidation", "Click on Edit button"); corpMasterdata_LanguageHelper.ClickForce("Edit"); executionLog.Log("LanguageNameValidation", "Remove text from the field"); corpMasterdata_LanguageHelper.removeText("LanguageBlank"); executionLog.Log("LanguageNameValidation", "Click on Check box"); corpMasterdata_LanguageHelper.Click("//div[@class='ibox-title']"); executionLog.Log("LanguageNameValidation", "Click on Save"); corpMasterdata_LanguageHelper.ClickForce("LanguageSave1"); executionLog.Log("LanguageNameValidation", "Verify error message"); corpMasterdata_LanguageHelper.VerifyPageText("Name: Field is required"); executionLog.Log("LanguageNameValidation", "Click on Close button"); corpMasterdata_LanguageHelper.ClickForce("LanguageClose"); executionLog.Log("LanguageNameValidation", "Click on Cancel button"); corpMasterdata_LanguageHelper.ClickForce("LanguageCancel"); executionLog.Log("LanguageNameValidation", "Click on Delete button"); corpMasterdata_LanguageHelper.ClickForce("Delete"); executionLog.Log("LanguageNameValidation", "Click on OK button"); corpMasterdata_LanguageHelper.ClickForce("LanguageOK"); executionLog.Log("LanguageNameValidation", "Logout from the application"); VisitCorp("logout"); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("LanguageNameValidation"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Language Name Validation"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Language Name Validation", "Bug", "Medium", "Corp Language page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Language Name Validation"); TakeScreenshot("LanguageNameValidation"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\LanguageNameValidation.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("LanguageNameValidation"); string id = loginHelper.getIssueID("Language Name Validation"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\LanguageNameValidation.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Language Name Validation"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Language Name Validation"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("LanguageNameValidation"); executionLog.WriteInExcel("Language Name Validation", Status, JIRA, "Corp Master Data"); } }
public void languageCorp() { string[] username = null; string[] password = null; var oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); // Initializing the objects var executionLog = new ExecutionLog(); var loginHelper = new LoginHelper(GetWebDriver()); var corpMasterdata_LanguageHelper = new CorpMasterdata_LanguageHelper(GetWebDriver()); username = oXMLData.getData("settings/Credentials", "username_corp"); password = oXMLData.getData("settings/Credentials", "password"); // Variable var Elang = "Corp Lang" + GetRandomNumber(); var lang = "Test" + GetRandomNumber(); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("LanguageCorp", "Login with valid credential Username"); Login(username[0], password[0]); corpMasterdata_LanguageHelper.WaitForWorkAround(3000); executionLog.Log("LanguageCorp", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("LanguageCorp", "Redirect To Language"); VisitCorp("languages"); executionLog.Log("LanguageCorp", "Verify Page title"); VerifyTitle("Languages"); executionLog.Log("LanguageCorp", "Click On Create Btn"); corpMasterdata_LanguageHelper.ClickElement("Create"); corpMasterdata_LanguageHelper.WaitForWorkAround(3000); executionLog.Log("LanguageCorp", "Enter Language Name"); corpMasterdata_LanguageHelper.TypeText("Language", lang); executionLog.Log("LanguageCorp", "Clcik on Save button"); corpMasterdata_LanguageHelper.ClickElement("Save"); executionLog.Log("LanguageCorp", "Wait for confirmation."); corpMasterdata_LanguageHelper.WaitForText("Language Created Successfully", 10); corpMasterdata_LanguageHelper.WaitForWorkAround(3000); executionLog.Log("LanguageCorp", "Search Language"); corpMasterdata_LanguageHelper.TypeText("SearchLang", lang); corpMasterdata_LanguageHelper.WaitForWorkAround(3000); executionLog.Log("LanguageCorp", "Click on Edit language"); corpMasterdata_LanguageHelper.ClickElement("Edit"); executionLog.Log("LanguageCorp", "Enter Language Name"); corpMasterdata_LanguageHelper.TypeText("EditLanguage", Elang); executionLog.Log("LanguageCorp", "Click On Save Button"); corpMasterdata_LanguageHelper.ClickElement("SaveEditLanguage"); corpMasterdata_LanguageHelper.WaitForWorkAround(3000); executionLog.Log("LanguageCorp", "Click On Del Lang"); corpMasterdata_LanguageHelper.ClickElement("Delete"); executionLog.Log("LanguageCorp", "Click On Delete popup."); corpMasterdata_LanguageHelper.ClickElement("DeletePopup"); corpMasterdata_LanguageHelper.WaitForWorkAround(3000); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("LanguageCorp"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Language Corp"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Language Corp", "Bug", "Medium", "Language page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Language Corp"); TakeScreenshot("LanguageCorp"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\LanguageCorp.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("LanguageCorp"); string id = loginHelper.getIssueID("Language Corp"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\LanguageCorp.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Language Corp"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Language Corp"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("LanguageCorp"); executionLog.WriteInExcel("Language Corp", Status, JIRA, "Master Data"); } }
public void languagePushToOffice() { string[] username = null; string[] username1 = null; string[] password = null; var oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); // Initializing the objects var executionLog = new ExecutionLog(); var loginHelper = new LoginHelper(GetWebDriver()); var corpMasterdata_LanguageHelper = new CorpMasterdata_LanguageHelper(GetWebDriver()); username = oXMLData.getData("settings/Credentials", "username_corp"); username1 = oXMLData.getData("settings/Credentials", "username_office"); password = oXMLData.getData("settings/Credentials", "password"); // Variable var mail = "Test" + RandomNumber(1, 99) + "@yopmail.com"; var numb = "12345678" + RandomNumber(10, 99); var lang = "Test" + RandomNumber(99, 999); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("CreateLanguageCorp", "Login with valid credential Username"); Login(username[0], password[0]); executionLog.Log("CreateLanguageCorp", "Verify Page title"); VerifyTitle("Dashboard"); executionLog.Log("CreateLanguageCorp", "Redirect To Language"); VisitCorp("languages"); corpMasterdata_LanguageHelper.WaitForWorkAround(3000); executionLog.Log("CreateLanguageCorp", "Verify Page title"); VerifyTitle("Languages"); executionLog.Log("CreateLanguageCorp", "Click On Create Btn"); corpMasterdata_LanguageHelper.ClickElement("Create"); corpMasterdata_LanguageHelper.WaitForWorkAround(2000); executionLog.Log("CreateLanguageCorp", "Enter Language Name"); corpMasterdata_LanguageHelper.TypeText("Language", lang); executionLog.Log("CreateLanguageCorp", "Clcik on Master Data"); corpMasterdata_LanguageHelper.ClickElement("Save"); executionLog.Log("CreateLanguageCorp", "Verify Text"); corpMasterdata_LanguageHelper.WaitForText("Language Created Successfully", 10); executionLog.Log("LanguagePushToOffice", "Click on Push To Office"); corpMasterdata_LanguageHelper.ClickElement("PushToOfficeLang"); executionLog.Log("LanguagePushToOffice", "Click ok To Confirm"); corpMasterdata_LanguageHelper.AcceptAlert(); executionLog.Log("LanguagePushToOffice", "Verify Confirmation Languges Successfully Pushed to Offices."); corpMasterdata_LanguageHelper.WaitForText("Languges Successfully Pushed to Offices.", 30); executionLog.Log("LanguagePushToOffice", " Logout button"); VisitCorp("logout"); //corpMasterdata_LanguageHelper.WaitForWorkAround(2000); Login(username1[0], password[0]); corpMasterdata_LanguageHelper.WaitForWorkAround(3000); if (GetWebDriver().Title == "Login") { Login(username1[0], password[0]); } VerifyTitle("Dashboard"); executionLog.Log("LanguagePushToOffice", "Redirect to language"); VisitOffice("languages"); corpMasterdata_LanguageHelper.WaitForWorkAround(3000); VerifyTitle("Languages"); executionLog.Log("LanguagePushToOffice", "Search pushed language"); corpMasterdata_LanguageHelper.TypeText("SearchLanguageOffice", lang); corpMasterdata_LanguageHelper.WaitForWorkAround(2000); executionLog.Log("LanguagePushToOffice", "Verify"); corpMasterdata_LanguageHelper.VerifyPageText(lang); executionLog.Log("AmexRatesPushToOffice", "Logout button"); VisitOffice("logout"); executionLog.Log("AmexRatesPushToOffice", "Login with valid credential"); Login(username[0], password[0]); executionLog.Log("AmexRatesPushToOffice", "Verify Page title"); VerifyTitle("Dashboard"); executionLog.Log("CreateLanguageCorp", "Redirect To Language"); VisitCorp("languages"); corpMasterdata_LanguageHelper.WaitForWorkAround(3000); executionLog.Log("CreateDepartmentOffice", "Enter Name to search"); corpMasterdata_LanguageHelper.TypeText("SearchLang", lang); corpMasterdata_LanguageHelper.WaitForWorkAround(2000); executionLog.Log("CreateLanguageCorp", "Click Delete btn "); corpMasterdata_LanguageHelper.ClickElement("Delete"); executionLog.Log("CreateLanguageCorp", "Click Delete btn "); corpMasterdata_LanguageHelper.ClickElement("DeletePopup"); corpMasterdata_LanguageHelper.WaitForWorkAround(4000); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("LanguagePushToOffice"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Language Push To Office"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Language Push To Office", "Bug", "Medium", "language page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Language Push To Office"); TakeScreenshot("LanguagePushToOffice"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\LanguagePushToOffice.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("LanguagePushToOffice"); string id = loginHelper.getIssueID("Language Push To Office"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\LanguagePushToOffice.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Language Push To Office"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Language Push To Office"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("LanguagePushToOffice"); executionLog.WriteInExcel("Language Push To Office", Status, JIRA, "Master Data"); } }
public void pushToOffice() { var oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); // Initializing the objects var executionLog = new ExecutionLog(); var corpMasterdata_LanguageHelper = new CorpMasterdata_LanguageHelper(GetWebDriver()); var loginHelper = new LoginHelper(GetWebDriver()); var corpMasterdata_MerchantTypeHelper = new CorpMasterdata_MerchantTypeHelper(GetWebDriver()); var corpMasterData_AmexRateHelper = new CorpMasterData_AmexRateHelper(GetWebDriver()); var corpMasterdata_OmahaAuthGridHelper = new CorpMasterdata_OmahaAuthGridHelper(GetWebDriver()); var corpMasterdata_PricingPlanHelper = new CorpMasterdata_PricingPlanHelper(GetWebDriver()); string[] username = null; string[] password = null; username = oXMLData.getData("settings/Credentials", "username_corp"); password = oXMLData.getData("settings/Credentials", "password"); // Variable var Num = RandomNumber(1, 9999).ToString(); var Nam = "New" + GetRandomNumber(); var name = "Test" + GetRandomNumber(); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("PushToOffice", "Login with valid credential"); Login(username[0], password[0]); executionLog.Log("PushToOffice", "Verify Page title"); VerifyTitle("Dashboard"); corpMasterdata_LanguageHelper.WaitForWorkAround(3000); executionLog.Log("CreateLanguageCorp", "Redirect To Language"); VisitCorp("languages"); corpMasterdata_LanguageHelper.WaitForWorkAround(3000); executionLog.Log("PushToOffice", "Verify Page title"); VerifyTitle("Languages"); executionLog.Log("LanguagePushToOffice", "Click on Push To Office"); corpMasterdata_LanguageHelper.ClickElement("PushToOfficeLang"); executionLog.Log("LanguagePushToOffice", "Click ok To Confirm"); corpMasterdata_LanguageHelper.AcceptAlert(); executionLog.Log("LanguagePushToOffice", "Verify Confirmation Languges Successfully Pushed to Offices."); corpMasterdata_LanguageHelper.WaitForText("Languges Successfully Pushed to Offices.", 30); executionLog.Log("CreateMerchnatType", "Redirect to marchant type page"); VisitCorp("masterdata/merchant_types"); corpMasterdata_LanguageHelper.WaitForWorkAround(3000); executionLog.Log("PushToOffice", "Verify Page title"); VerifyTitle("Master Merchant Types"); executionLog.Log("CreateMerchnatType", "Click On Push Office"); corpMasterdata_MerchantTypeHelper.ClickElement("PushOffice"); executionLog.Log("LanguagePushToOffice", "Click ok To Confirm"); corpMasterdata_MerchantTypeHelper.AcceptAlert(); executionLog.Log("CreateOmahaAuthGrid", "Redirect To URL"); VisitCorp("masterdata/omaha_auth_grids"); corpMasterdata_LanguageHelper.WaitForWorkAround(3000); executionLog.Log("PushToOffice", "Verify Page title"); VerifyTitle("Corporate Master Omaha Auth Grids"); executionLog.Log("OmahaAuthGridPushToOffice", "Push To Office"); corpMasterdata_OmahaAuthGridHelper.ClickElement("PushToOffice"); executionLog.Log("OmahaAuthGridPushToOffice", "Click ok To Confirm"); corpMasterdata_OmahaAuthGridHelper.AcceptAlert(); executionLog.Log("OmahaAuthGridPushToOffice", "Verify Confirmation Languges Successfully Pushed to Offices."); corpMasterdata_OmahaAuthGridHelper.WaitForText("Omaha Auth Grids successfully pushed to offices.", 40); executionLog.Log("PricingPlanPushToOffice", "Procing plan page"); VisitCorp("masterdata/pricing_plans"); corpMasterdata_LanguageHelper.WaitForWorkAround(3000); executionLog.Log("PushToOffice", "Verify Page title"); VerifyTitle("Master Pricing Plans"); executionLog.Log("PricingPlanPushToOffice", "Click On Push Office"); corpMasterdata_PricingPlanHelper.ClickElement("PushOffice"); executionLog.Log("PushToOffice", "Accept alert message."); corpMasterdata_PricingPlanHelper.AcceptAlert(); executionLog.Log("PushToOffice", "Wait for success message."); corpMasterdata_PricingPlanHelper.WaitForText("Pricing Plans successfully pushed to offices.", 40); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("PushToOffice"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Push To Office"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Push To Office", "Bug", "Medium", "Master Data page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Push To Office"); TakeScreenshot("PushToOffice"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\PushToOffice.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("PushToOffice"); string id = loginHelper.getIssueID("Push To Office"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\PushToOffice.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Push To Office"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Push To Office"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("PushToOffice"); executionLog.WriteInExcel("Push To Office", Status, JIRA, "Corp Master Data"); } }