public void practicalPDFProblem() { string[] username = null; string[] password = null; var oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); username = oXMLData.getData("settings/Credentials", "username_corp"); password = oXMLData.getData("settings/Credentials", "password"); // Initializing the objects var executionLog = new ExecutionLog(); var loginHelper = new LoginHelper(GetWebDriver()); var corpPDFTemplate_ImportWizardHelper = new CorpPDFTemplate_ImportWizardHelper(GetWebDriver()); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("PracticalPDFProblem", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("PracticalPDFProblem", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("PracticalPDFProblem", "Redirect To tempalte"); VisitCorp("pdf_templates"); executionLog.Log("PracticalPDFProblem", "Redirect To Import"); VisitCorp("pdf_templates/import"); executionLog.Log("PracticalPDFProblem", "ChooseModule"); corpPDFTemplate_ImportWizardHelper.Select("SelectModule", "20"); var path = GetPathToFile() + "Test_Final.pdf"; executionLog.Log("PracticalPDFProblem", "upload file"); corpPDFTemplate_ImportWizardHelper.UploadFile("//*[@id='PdfTemplatePdfFile']", path); executionLog.Log("PracticalPDFProblem", "Click import"); corpPDFTemplate_ImportWizardHelper.ClickElement("Import"); corpPDFTemplate_ImportWizardHelper.WaitForWorkAround(4000); executionLog.Log("PracticalPDFProblem", "Select tab"); corpPDFTemplate_ImportWizardHelper.SelectByText("Tab", "Business Details"); corpPDFTemplate_ImportWizardHelper.WaitForWorkAround(2000); executionLog.Log("PracticalPDFProblem", "Verify fields availble under section"); corpPDFTemplate_ImportWizardHelper.SelectByText("Section", "Merchant Account Data"); corpPDFTemplate_ImportWizardHelper.WaitForWorkAround(2000); executionLog.Log("PracticalPDFProblem", "Verify fields under fields"); corpPDFTemplate_ImportWizardHelper.SelectByText("Fields", "Business Type"); executionLog.Log("PracticalPDFProblem", "Click on Next button"); corpPDFTemplate_ImportWizardHelper.ClickElement("Next"); executionLog.Log("PracticalPDFProblem", "Verify mapped successfully"); corpPDFTemplate_ImportWizardHelper.WaitForText("PDF fields mapped successfully.", 10); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("PracticalPDFProblem"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Practical PDF Problem"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Practical PDF Problem", "Bug", "Medium", "PDF page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Practical PDF Problem"); TakeScreenshot("PracticalPDFProblem"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\PracticalPDFProblem.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("PracticalPDFProblem"); string id = loginHelper.getIssueID("Practical PDF Problem"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\PracticalPDFProblem.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Practical PDF Problem"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Practical PDF Problem"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("PracticalPDFProblem"); executionLog.WriteInExcel("Practical PDF Problem", Status, JIRA, "PDF Import"); } }
public void permanentlyDeletePDFTemplateCorp() { string[] username = null; string[] password = null; var oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); username = oXMLData.getData("settings/Credentials", "username_corp"); password = oXMLData.getData("settings/Credentials", "password"); // Initializing the objects var executionLog = new ExecutionLog(); var loginHelper = new LoginHelper(GetWebDriver()); var corpPDFTemplate_ImportWizardHelper = new CorpPDFTemplate_ImportWizardHelper(GetWebDriver()); // Variable random var name = "TESTCLIENT" + RandomNumber(1, 999); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("PermanentlyDeletePDFTemplateCorp", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("PermanentlyDeletePDFTemplateCorp", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("PermanentlyDeletePDFTemplateCorp", "Redirect To Import"); VisitCorp("pdf_templates/import"); corpPDFTemplate_ImportWizardHelper.WaitForWorkAround(3000); executionLog.Log("PermanentlyDeletePDFTemplateCorp", "ChooseModule"); corpPDFTemplate_ImportWizardHelper.SelectByText("SelectModule", "Clients"); var path = GetPathToFile() + "2.pdf"; executionLog.Log("PermanentlyDeletePDFTemplateCorp", "Uplaod file"); corpPDFTemplate_ImportWizardHelper.UploadFile("//*[@id='PdfTemplatePdfFile']", path); executionLog.Log("PermanentlyDeletePDFTemplateCorp", "Click import"); corpPDFTemplate_ImportWizardHelper.ClickElement("Import"); corpPDFTemplate_ImportWizardHelper.WaitForWorkAround(3000); executionLog.Log("PermanentlyDeletePDFTemplateCorp", "ClickOnNext"); corpPDFTemplate_ImportWizardHelper.ClickElement("ClickOnNext"); corpPDFTemplate_ImportWizardHelper.WaitForWorkAround(2000); executionLog.Log("PermanentlyDeletePDFTemplateCorp", "Select Category"); corpPDFTemplate_ImportWizardHelper.SelectDropDownByText("//*[@id='PdfTemplatePdfCategoryId']", "Card Service Agreements"); executionLog.Log("PermanentlyDeletePDFTemplateCorp", "ClickOnSave"); corpPDFTemplate_ImportWizardHelper.ClickElement("Save"); executionLog.Log("PermanentlyDeletePDFTemplateCorp", "Verify message"); corpPDFTemplate_ImportWizardHelper.WaitForText("PDF Template options saved successfully.", 10); executionLog.Log("PermanentlyDeletePDFTemplateCorp", "Redirect at templated page."); VisitCorp("pdf_templates"); corpPDFTemplate_ImportWizardHelper.WaitForWorkAround(3000); executionLog.Log("PermanentlyDeletePDFTemplateCorp", "Enter PDF TO sEARCH"); corpPDFTemplate_ImportWizardHelper.TypeText("SearchPDF", "2.pdf"); corpPDFTemplate_ImportWizardHelper.WaitForWorkAround(2000); executionLog.Log("PermanentlyDeletePDFTemplateCorp", "SelectModuleToSearch"); corpPDFTemplate_ImportWizardHelper.Select("ModuleToSearch", "clients"); corpPDFTemplate_ImportWizardHelper.WaitForWorkAround(2000); executionLog.Log("PermanentlyDeletePDFTemplateCorp", "cLICK ON pdf"); corpPDFTemplate_ImportWizardHelper.ClickElement("PDF1"); corpPDFTemplate_ImportWizardHelper.WaitForWorkAround(2000); executionLog.Log("PermanentlyDeletePDFTemplateCorp", "cLICK On Delete"); corpPDFTemplate_ImportWizardHelper.ClickElement("DeletePDF"); executionLog.Log("PermanentlyDeletePDFTemplateCorp", "Accept alert message."); corpPDFTemplate_ImportWizardHelper.AcceptAlert(); executionLog.Log("PermanentlyDeletePDFTemplateCorp", "Redirect to template"); VisitCorp("pdf_templates"); executionLog.Log("PermanentlyDeletePDFTemplateCorp", "Click on recycle bin"); corpPDFTemplate_ImportWizardHelper.ClickElement("ClickOnReCycleBin"); corpPDFTemplate_ImportWizardHelper.WaitForWorkAround(2000); executionLog.Log("PermanentlyDeletePDFTemplateCorp", "Click on delete item."); corpPDFTemplate_ImportWizardHelper.ClickElement("PermanentlyDeleteFrmRecycleBin"); executionLog.Log("PermanentlyDeletePDFTemplateCorp", "Accept alert message."); corpPDFTemplate_ImportWizardHelper.AcceptAlert(); executionLog.Log("PermanentlyDeletePDFTemplateCorp", "PDF Template Restored Successfully."); corpPDFTemplate_ImportWizardHelper.WaitForText("PDF Template Permanently Deleted.", 10); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("PermanentlyDeletePDFTemplateCorp"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Permanently Delete PDF Template Corp"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Permanently Delete PDF Template Corp", "Bug", "Medium", "Pdf Template page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Permanently Delete PDF Template Corp"); TakeScreenshot("PermanentlyDeletePDFTemplateCorp"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\PermanentlyDeletePDFTemplateCorp.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("PermanentlyDeletePDFTemplateCorp"); string id = loginHelper.getIssueID("Permanently Delete PDF Template Corp"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\PermanentlyDeletePDFTemplateCorp.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Permanently Delete PDF Template Corp"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Permanently Delete PDF Template Corp"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("PermanentlyDeletePDFTemplateCorp"); executionLog.WriteInExcel("Permanently Delete PDF Template Corp", Status, JIRA, "PDF Template"); } }
public void pDFImpotWizard() { string[] username = null; string[] username1 = null; string[] password = null; var oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); username = oXMLData.getData("settings/Credentials", "username_corp"); username1 = oXMLData.getData("settings/Credentials", "username_office"); password = oXMLData.getData("settings/Credentials", "password"); // Initializing the objects var executionLog = new ExecutionLog(); var loginHelper = new LoginHelper(GetWebDriver()); var pDFTemplate_ImportWizardHelper = new PDFTemplate_ImportWizardHelper(GetWebDriver()); var pDFTemplate_PDFTemplateHelper = new PDFTemplate_PDFTemplateHelper(GetWebDriver()); var corpPDFTemplate_ImportWizardHelper = new CorpPDFTemplate_ImportWizardHelper(GetWebDriver()); var corpPDFTemplate_CategoriesHelper = new CorpPDFTemplate_CategoriesHelper(GetWebDriver()); // Variable random var Category = "Category" + RandomNumber(1, 99999); var name = "TestMerchant" + GetRandomNumber(); var FilePth = GetPathToFile() + "real.pdf"; var InvalidFilePath = GetPathToFile() + "clientsamples(2).csv"; String JIRA = ""; String Status = "Pass"; try { executionLog.Log("PDFImpotWizard", "Login with valid username and password"); Login(username[0], password[0]); executionLog.Log("PDFImpotWizard", "Verify Page title"); VerifyTitle("Dashboard"); executionLog.Log("PDFImpotWizard", "Redirect at pdf categories pge."); VisitCorp("pdf_templates/categories"); corpPDFTemplate_CategoriesHelper.WaitForWorkAround(3000); executionLog.Log("PDFImpotWizard", "Click Create PDF Template"); corpPDFTemplate_CategoriesHelper.ClickElement("Create"); corpPDFTemplate_CategoriesHelper.WaitForWorkAround(3000); executionLog.Log("PDFImpotWizard", "Enter PDF NAME"); corpPDFTemplate_CategoriesHelper.TypeText("EnterName", Category); executionLog.Log("PDFImpotWizard", "Click on Save"); corpPDFTemplate_CategoriesHelper.ClickElement("Save"); executionLog.Log("PDFImpotWizard", "Wait for Confirmation"); corpPDFTemplate_CategoriesHelper.WaitForText("Category Created Successfully", 10); executionLog.Log("PDFImpotWizard", "Visit pdf Template import page"); VisitCorp("pdf_templates/import"); corpPDFTemplate_CategoriesHelper.WaitForWorkAround(3000); executionLog.Log("PDFImpotWizard", "Select Module."); corpPDFTemplate_ImportWizardHelper.SelectByText("SelectModule", "Clients"); executionLog.Log("PDFImpotWizard", "Uplaod File"); corpPDFTemplate_ImportWizardHelper.UploadFile("//*[@id='PdfTemplatePdfFile']", FilePth); corpPDFTemplate_CategoriesHelper.WaitForWorkAround(1000); executionLog.Log("PDFImpotWizard", "Click on Import"); corpPDFTemplate_ImportWizardHelper.ClickElement("Import"); executionLog.Log("PDFImpotWizard", "Wait for next button to appear."); corpPDFTemplate_ImportWizardHelper.WaitForElementPresent("ClickNextbtn", 10); executionLog.Log("PDFImpotWizard", "Click on Next"); corpPDFTemplate_ImportWizardHelper.ClickDisplayed("//button[@title='Next']"); corpPDFTemplate_CategoriesHelper.WaitForWorkAround(3000); executionLog.Log("PDFImpotWizard", "Wait for Confirmation"); corpPDFTemplate_ImportWizardHelper.WaitForText("PDF fields mapped successfully.", 05); executionLog.Log("PDFImpotWizard", "Wait for next button to appear."); corpPDFTemplate_ImportWizardHelper.WaitForElementPresent("ClickNextBtn2", 10); executionLog.Log("PDFImpotWizard", "Click on Next button again"); corpPDFTemplate_ImportWizardHelper.ClickElement("ClickNextBtn2"); executionLog.Log("PDFImpotWizard", "Verify confirmation"); corpPDFTemplate_ImportWizardHelper.WaitForText("Signature Options saved successfully.", 10); executionLog.Log("PDFImpotWizard", "Select Category"); corpPDFTemplate_ImportWizardHelper.SelectByText("SelectCatory", "Card Service Agreements"); executionLog.Log("PDFImpotWizard", "Click on Save"); corpPDFTemplate_ImportWizardHelper.ClickElement("Save"); executionLog.Log("PDFImpotWizard", "Verif Confirmation"); corpPDFTemplate_ImportWizardHelper.WaitForText("PDF Template options saved successfully.", 10); executionLog.Log("PDFImpotWizard", "Visit pdf Template import page"); VisitCorp("pdf_templates/import"); corpPDFTemplate_CategoriesHelper.WaitForWorkAround(3000); executionLog.Log("PDFImpotWizard", "Click Import"); corpPDFTemplate_ImportWizardHelper.ClickElement("Import"); //corpPDFTemplate_CategoriesHelper.WaitForWorkAround(3000); executionLog.Log("PDFImpotWizard", "Wait for validation text."); corpPDFTemplate_ImportWizardHelper.WaitForText("This field is required.", 10); executionLog.Log("PDFImpotWizard", "Click on cancel."); corpPDFTemplate_ImportWizardHelper.ClickDisplayed("//a[@title='Cancel']"); corpPDFTemplate_CategoriesHelper.WaitForWorkAround(3000); executionLog.Log("PDFImpotWizard", "Verify text on page."); corpPDFTemplate_ImportWizardHelper.VerifyText("VerifyTextPDFTemplatesHeader", "PDF Templates"); executionLog.Log("PDFImpotWizard", "Visit pdf Template import page"); VisitCorp("pdf_templates/import"); corpPDFTemplate_CategoriesHelper.WaitForWorkAround(3000); executionLog.Log("PDFImpotWizard", "Select Module"); corpPDFTemplate_ImportWizardHelper.SelectByText("SelectModule", "Clients"); executionLog.Log("PDFImpotWizard", "Uplaod File"); corpPDFTemplate_ImportWizardHelper.UploadFile("//*[@id='PdfTemplatePdfFile']", InvalidFilePath); corpPDFTemplate_CategoriesHelper.WaitForWorkAround(1000); executionLog.Log("PDFImpotWizard", "Click Import"); corpPDFTemplate_ImportWizardHelper.ClickElement("Import"); corpPDFTemplate_CategoriesHelper.WaitForWorkAround(3000); executionLog.Log("PDFImpotWizard", "Accept alert message."); corpPDFTemplate_ImportWizardHelper.AcceptAlert(); executionLog.Log("PDFImpotWizard", "Logout from the application."); VisitCorp("logout"); executionLog.Log("PDFImpotWizard", "Login to the office module."); Login(username1[0], password[0]); corpPDFTemplate_CategoriesHelper.WaitForWorkAround(2000); executionLog.Log("PDFImpotWizard", "Goto PDF Categories"); VisitOffice("pdf_templates/categories"); corpPDFTemplate_CategoriesHelper.WaitForWorkAround(4000); executionLog.Log("PDFImpotWizard", "Click Create PDF Template"); pDFTemplate_PDFTemplateHelper.ClickElement("ClickCreatePDFImp"); corpPDFTemplate_CategoriesHelper.WaitForWorkAround(1000); executionLog.Log("PDFImpotWizard", "Enter PDF Category Name"); pDFTemplate_PDFTemplateHelper.TypeText("EnterPDFCategoryName", Category); executionLog.Log("PDFImpotWizard", "Click on Save"); pDFTemplate_PDFTemplateHelper.ClickElement("PDFImportSave"); corpPDFTemplate_CategoriesHelper.WaitForWorkAround(3000); executionLog.Log("PDFImpotWizard", "Goto pdf template import"); VisitOffice("pdf_templates/import"); corpPDFTemplate_CategoriesHelper.WaitForWorkAround(3000); executionLog.Log("PDFImpotWizard", "Select Module"); pDFTemplate_ImportWizardHelper.SelectByText("SelectModule", "Clients"); corpPDFTemplate_CategoriesHelper.WaitForWorkAround(1000); executionLog.Log("PDFImpotWizard", "Upload file."); pDFTemplate_ImportWizardHelper.UploadFile("//*[@id='PdfTemplatePdfFile']", FilePth); corpPDFTemplate_CategoriesHelper.WaitForWorkAround(1000); executionLog.Log("PDFImpotWizard", "Click Import PDF"); pDFTemplate_ImportWizardHelper.ClickElement("Import"); executionLog.Log("PDFImpotWizard", "Wait for next button to appear."); pDFTemplate_ImportWizardHelper.WaitForElementPresent("ClickNextbtn", 10); executionLog.Log("PDFImpotWizard", "Click Next button"); pDFTemplate_ImportWizardHelper.ClickElement("Next"); corpPDFTemplate_CategoriesHelper.WaitForWorkAround(3000); executionLog.Log("PDFImpotWizard", "Verify Confirmation"); pDFTemplate_ImportWizardHelper.WaitForText("PDF fields mapped successfully.", 10); executionLog.Log("PDFImpotWizard", "Wait for next button to appear."); pDFTemplate_ImportWizardHelper.WaitForElementPresent("ClickNextBtn2", 10); executionLog.Log("PDFImpotWizard", "Click Next button"); pDFTemplate_ImportWizardHelper.ClickElement("ClickNextBtn2"); corpPDFTemplate_CategoriesHelper.WaitForWorkAround(3000); executionLog.Log("PDFImpotWizard", "Select Category."); pDFTemplate_ImportWizardHelper.SelectByText("Category", "Card Service Agreements"); corpPDFTemplate_CategoriesHelper.WaitForWorkAround(1000); executionLog.Log("PDFImpotWizard", "Click on Save"); pDFTemplate_ImportWizardHelper.ClickElement("Save"); executionLog.Log("PDFImpotWizard", "Wait for Confirmation"); pDFTemplate_ImportWizardHelper.WaitForText("PDF Template options saved successfully.", 10); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("PDFImpotWizard"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("PDF Impot Wizard"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("PDF Impot Wizard", "Bug", "Medium", "PDF page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("PDF Impot Wizard"); TakeScreenshot("PDFImpotWizard"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\PDFImpotWizard.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("PDFImpotWizard"); string id = loginHelper.getIssueID("PDF Impot Wizard"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\PDFImpotWizard.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("PDF Impot Wizard"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("PDF Impot Wizard"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("PDFImpotWizard"); executionLog.WriteInExcel("PDF Impot Wizard", Status, JIRA, "PDF Import"); } }