public void verifyCompanyNameOfMerchantOwnerContact() { string[] username = null; string[] password = null; var oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); username = 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 office_ClientsHelper = new Office_ClientsHelper(GetWebDriver()); var office_ContactsHelper = new Office_ContactsHelper(GetWebDriver()); var DBA = "ClientDBA" + RandomNumber(111, 999999); var ownername = "Owner" + DBA; // Variable random String JIRA = ""; String Status = "Pass"; try { executionLog.Log("VerifyCompanyNameOfMerchantOwnerContact", "Login with valid username and password"); Login(username[0], password[0]); executionLog.Log("VerifyCompanyNameOfMerchantOwnerContact", "Verify Page title"); VerifyTitle("Dashboard"); executionLog.Log("VerifyCompanyNameOfMerchantOwnerContact", "Redirect at Create merchant page"); VisitOffice("clients/create"); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyCompanyNameOfMerchantOwnerContact", "Enter DBA name"); office_ClientsHelper.TypeText("ClientDBAName", DBA); executionLog.Log("VerifyCompanyNameOfMerchantOwnerContact", "Select the client status"); office_ClientsHelper.SelectByText("Status", "New"); executionLog.Log("VerifyCompanyNameOfMerchantOwnerContact", "select the responsibity"); office_ClientsHelper.SelectByText("Responsibility", "Howard Tang"); executionLog.Log("VerifyCompanyNameOfMerchantOwnerContact", "Click on save btn"); office_ClientsHelper.ClickElement("Save"); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyCompanyNameOfMerchantOwnerContact", "Go to Owners tab"); office_ClientsHelper.ClickElement("OwnerTab"); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyCompanyNameOfMerchantOwnerContact", "Enter Title"); office_ClientsHelper.TypeText("TitleOwner", "Title"); executionLog.Log("VerifyCompanyNameOfMerchantOwnerContact", "Enter Owner First Name"); office_ClientsHelper.TypeText("OwnerFirstName", ownername); executionLog.Log("VerifyCompanyNameOfMerchantOwnerContact", "Enter Owner Last Name"); office_ClientsHelper.TypeText("OwnerLastName", "Owner"); executionLog.Log("VerifyCompanyNameOfMerchantOwnerContact", "Click on Save button"); office_ClientsHelper.ClickElement("OwnerSave"); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyCompanyNameOfMerchantOwnerContact", "Redirect at All Contacts page"); VisitOffice("contacts"); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyCompanyNameOfMerchantOwnerContact", "Search Contact Name"); office_ContactsHelper.TypeText("SearchName", ownername); office_ContactsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyCompanyNameOfMerchantOwnerContact", "Verify Company name"); office_ContactsHelper.VerifyText("FirstCompName", DBA); executionLog.Log("VerifyCompanyNameOfMerchantOwnerContact", "Redirect at All merchants page"); VisitOffice("clients"); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyCompanyNameOfMerchantOwnerContact", "Search the company Name"); office_ClientsHelper.TypeText("SearchClient", DBA); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyCompanyNameOfMerchantOwnerContact", "Click on check box"); office_ClientsHelper.ClickElement("ClickOnCheckBox"); executionLog.Log("VerifyCompanyNameOfMerchantOwnerContact", "Delete the client"); office_ClientsHelper.ClickJS("DeleteClient"); office_ClientsHelper.AcceptAlert(); office_ClientsHelper.WaitForWorkAround(3000); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("VerifyCompanyNameOfMerchantOwnerContact"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Verify Company Name Of Merchant Owner Contact"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Verify Company Name Of Merchant Owner Contact", "Bug", "Medium", "Office Merchant page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Verify Company Name Of Merchant Owner Contact"); TakeScreenshot("VerifyCompanyNameOfMerchantOwnerContact"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyCompanyNameOfMerchantOwnerContact.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("VerifyCompanyNameOfMerchantOwnerContact"); string id = loginHelper.getIssueID("Verify Company Name Of Merchant Owner Contact"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyCompanyNameOfMerchantOwnerContact.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Verify Company Name Of Merchant Owner Contact"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Verify Company Name Of Merchant Owner Contact"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("VerifyCompanyNameOfMerchantOwnerContact"); executionLog.WriteInExcel("Verify Company Name Of Merchant Owner Contact", Status, JIRA, "Office Merchants"); } }
public void getDefaultRatesAndFeesClient() { string[] username = null; string[] password = null; var oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); username = 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 office_ClientsHelper = new Office_ClientsHelper(GetWebDriver()); // VARIABLE var DBA = "Client" + RandomNumber(111, 9999); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("GetDefaultRatesAndFeesClient", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("GetDefaultRatesAndFeesClient", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("GetDefaultRatesAndFeesClient", "Redirect at create client page."); VisitOffice("clients/create"); executionLog.Log("ClientZipCodeAutoPopulationIssue", "Enter Client Dba Name"); office_ClientsHelper.TypeText("ClientDBAName", DBA); executionLog.Log("ClientZipCodeAutoPopulationIssue", "Select client status"); office_ClientsHelper.SelectByText("ClientStatus", "New"); executionLog.Log("ClientZipCodeAutoPopulationIssue", "Select Client Res[onsibility."); office_ClientsHelper.SelectByText("ClientResponsibility", "Howard Tang"); executionLog.Log("ClientZipCodeAutoPopulationIssue", "Click on next button"); office_ClientsHelper.ClickElement("Next"); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("ClientZipCodeAutoPopulationIssue", "Wait for confirmation message."); office_ClientsHelper.WaitForText("Client saved successfully. ", 10); executionLog.Log("GetDefaultRatesAndFeesClient", "Click on rates and fee tab."); office_ClientsHelper.ClickElement("RatesAndFee"); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("GetDefaultRatesAndFeesClient", " SelectProcessorRF"); office_ClientsHelper.Select("SelectProcessorRF", "First Data Omaha"); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("GetDefaultRatesAndFeesClient", " Select Merchant RF"); office_ClientsHelper.Select("SeleectMerchantRF", "TestMerchant201603290147173188"); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("GetDefaultRatesAndFeesClient", " SelectProcessorRF"); office_ClientsHelper.Select("MethodOfAcceptingRF", "Manually swiped"); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("GetDefaultRatesAndFeesClient", "Click On Get Default Rates"); office_ClientsHelper.ClickElement("ClickOnGetDefaultRates"); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("GetDefaultRatesAndFeesClient", "Accept alert message."); office_ClientsHelper.AcceptAlert(); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("GetDefaultRatesAndFeesClient", "Verify"); office_ClientsHelper.IsElementPresent("VerifyPopulatedFiedl"); office_ClientsHelper.WaitForWorkAround(4000); executionLog.Log("ClientZipCodeAutoPopulationIssue", "Redirect at clients page."); VisitOffice("clients"); executionLog.Log("ClientZipCodeAutoPopulationIssue", "Enter Company Name"); office_ClientsHelper.TypeText("SearchClient", DBA); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("ClientZipCodeAutoPopulationIssue", "Select client by check box"); office_ClientsHelper.ClickElement("ClickOn1stOpp"); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("ClientZipCodeAutoPopulationIssue", "Click on delete client"); office_ClientsHelper.ClickElement("DeleteClient"); executionLog.Log("ClientZipCodeAutoPopulationIssue", "Accept alert message."); office_ClientsHelper.AcceptAlert(); executionLog.Log("ClientZipCodeAutoPopulationIssue", "Wait for success message."); office_ClientsHelper.WaitForText("1 records deleted successfully", 10); executionLog.Log("ClientZipCodeAutoPopulationIssue", "Redirect To client recycle bin page. "); VisitOffice("clients/recyclebin"); executionLog.Log("ClientZipCodeAutoPopulationIssue", "Enter Company Name"); office_ClientsHelper.TypeText("SearchClient", DBA); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("ClientZipCodeAutoPopulationIssue", "Click on delete client"); office_ClientsHelper.ClickElement("DeleteRbin"); executionLog.Log("ClientZipCodeAutoPopulationIssue", "Accept alert message."); office_ClientsHelper.AcceptAlert(); executionLog.Log("ClientZipCodeAutoPopulationIssue", "Wait for success message."); office_ClientsHelper.WaitForText("Client Permanently Deleted.", 10); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("GetDefaultRatesAndFeesClient"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Get Default Rates And Fees Client"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Get Default Rates And Fees Client", "Bug", "Medium", "Rate and fee page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Get Default Rates And Fees Client"); TakeScreenshot("GetDefaultRatesAndFeesClient"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\GetDefaultRatesAndFeesClient.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("GetDefaultRatesAndFeesClient"); string id = loginHelper.getIssueID("Get Default Rates And Fees Client"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\GetDefaultRatesAndFeesClient.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Get Default Rates And Fees Client"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Get Default Rates And Fees Client"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("GetDefaultRatesAndFeesClient"); executionLog.WriteInExcel("Get Default Rates And Fees Client", Status, JIRA, "Client Management"); } }
public void verifyCreatedModifiedByForConvertedClient() { string[] username = null; string[] password = null; var oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); username = oXMLData.getData("settings/Credentials", "username"); password = oXMLData.getData("settings/Credentials", "password"); // Initializing the objects var executionLog = new ExecutionLog(); var loginHelper = new LoginHelper(GetWebDriver()); var office_LeadsHelper = new Office_LeadsHelper(GetWebDriver()); var office_ClientsHelper = new Office_ClientsHelper(GetWebDriver()); // VARIABLE var name = "TestEmployee" + GetRandomNumber(); var Company = "My Company" + RandomNumber(1, 999); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Login with valid username and password"); Login(username[0], password[0]); executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Verify Page title"); VerifyTitle("Dashboard"); executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Redirect To create lead page"); VisitOffice("leads/create"); executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Click on Assignments"); office_LeadsHelper.ClickElement("Assignments"); executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Wait for element to be visible."); office_LeadsHelper.WaitForElementPresent("LeadStatus", 10); executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Select Lead Status"); office_LeadsHelper.Select("LeadStatus", "New"); executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "LeadResponsibility"); office_LeadsHelper.SelectByText("LeadResponsibility", "Howard Tang"); executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Click on companu details tab"); office_LeadsHelper.ClickElement("CompanyDetails"); executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Enter First Name "); office_LeadsHelper.TypeText("FirstNameLead", "Test Lead"); executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "EnterLastName"); office_LeadsHelper.TypeText("LastName", "Tester"); executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Enter Company Nmae"); office_LeadsHelper.TypeText("CompanyName", Company); executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Click on Save"); office_LeadsHelper.ClickElement("Save"); office_LeadsHelper.WaitForWorkAround(7000); var LocDub = "//button[text()='Create Duplicate']"; if (office_LeadsHelper.IsElementPresent(LocDub)) { office_LeadsHelper.Click(LocDub); } executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Click on Convert"); office_LeadsHelper.ClickElement("ClickConvert"); executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Yes Move To Recycle Bin"); office_LeadsHelper.ClickElement("ClickYes"); executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Click Convert Save Lead"); office_LeadsHelper.ClickElement("ConvertSaveLead"); office_LeadsHelper.WaitForWorkAround(4000); executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Verify messge"); office_LeadsHelper.VerifyPageText("Lead is converted and moved to recyclebin."); office_LeadsHelper.WaitForWorkAround(4000); executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Wait for locator to be present."); office_ClientsHelper.WaitForElementPresent("CreatedBy", 10); executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Verify client created by name."); office_ClientsHelper.VerifyText("CreatedBy", "Howard Tang"); executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Verify client modified b y name."); office_ClientsHelper.VerifyText("ModifiedBy", "Howard Tang"); executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Redirect To clients page. "); VisitOffice("clients"); executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Enter Company Name"); office_ClientsHelper.TypeText("SearchClient", Company); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Wait for locator to present."); office_ClientsHelper.WaitForElementPresent("ClickOn1stOpp", 10); executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Select client by check box"); office_ClientsHelper.ClickElement("ClickOn1stOpp"); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Click on delete client"); office_ClientsHelper.ClickElement("DeleteClient"); executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Accept alert message."); office_ClientsHelper.AcceptAlert(); executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Wait for success message."); office_ClientsHelper.WaitForText("1 records deleted successfully", 10); executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Redirect To leads recycle bin page. "); VisitOffice("leads/recyclebin"); executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Enter Company Name"); office_LeadsHelper.TypeText("SearchLeadRbin", Company); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Click on delete leads"); office_LeadsHelper.ClickElement("DeleteRbin"); executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Accept alert message."); office_LeadsHelper.AcceptAlert(); executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Wait for success message."); office_LeadsHelper.WaitForText("Lead Permanently Deleted.", 10); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("VerifyCreatedModifiedByForConvertedClient"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Verify Created Modified By For Converted Client"); if (!result) { if (Int16.Parse(counter) < 5) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Verify Created Modified By For Converted Client", "Bug", "Medium", "Lead page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Verify Created Modified By For Converted Client"); TakeScreenshot("VerifyCreatedModifiedByForConvertedClient"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyCreatedModifiedByForConvertedClient.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 5) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("VerifyCreatedModifiedByForConvertedClient"); string id = loginHelper.getIssueID("Verify Created Modified By For Converted Client"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyCreatedModifiedByForConvertedClient.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Verify Created Modified By For Converted Client"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Verify Created Modified By For Converted Client"); executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("VerifyCreatedModifiedByForConvertedClient"); executionLog.WriteInExcel("Verify Created Modified By For Converted Client", Status, JIRA, "Leads Management"); } }
public void setFieldToDecimal() { string[] username = null; string[] password = null; XMLParse oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); username = oXMLData.getData("settings/Credentials", "username_office"); password = oXMLData.getData("settings/Credentials", "password"); //Initializing the objects ExecutionLog executionLog = new ExecutionLog(); LoginHelper loginHelper = new LoginHelper(GetWebDriver()); var validate = new AdminSetFormatFieldsHelper(GetWebDriver()); var office_ClientsHelper = new Office_ClientsHelper(GetWebDriver()); //Random Variable String JIRA = ""; String Status = "Pass"; var DBAName = "DBA@Company" + RandomNumber(1, 999); try { executionLog.Log("AdminSetValidationDecimal", "Login"); Login(username[0], password[0]); //executionLog.Log("AdminSetValidationDecimal", "Wait"); //validate.WaitForWorkAround(4000); executionLog.Log("AdminSetValidationDecimal", "Verify Title Dashboard"); VerifyTitle("Dashboard"); //VisitOffice("clients"); //validate.WaitForWorkAround(3000); //executionLog.Log("AdminSetValidationDecimal", "Click CompanySearchBar"); //validate.ClickElement("CompanySearchBar"); //executionLog.Log("AdminSetValidationDecimal", "Ttype Text Client's name"); //validate.TypeText("CompanySearchBar", "Client's name"); //executionLog.Log("AdminSetValidationDecimal", "Click FirstClient"); //validate.ClickElement("FirstClient"); //executionLog.Log("AdminSetValidationDecimal", "Click Contacts"); //validate.ClickElement("Contacts"); //executionLog.Log("AdminSetValidationDecimal", "Wait"); //validate.WaitForElementPresent("Title", 2); //executionLog.Log("AdminSetValidationDecimal", "Click Save"); //validate.ClickElement("Save"); //executionLog.Log("AdminSetValidationDecimal", "Visit admin office"); //VisitOffice("admin"); //executionLog.Log("AdminSetValidationDecimal", "Wait"); //validate.WaitForWorkAround(2000); VisitOffice("fields"); validate.WaitForWorkAround(3000); validate.SelectByText("Module", "Clients"); validate.WaitForWorkAround(2000); executionLog.Log("AdminSetValidationDecimal", "Select Processor as First Data North"); validate.SelectByText("Processor", "First Data North"); validate.WaitForWorkAround(2000); executionLog.Log("AdminSetValidationDecimal", "Select Tab as Contacts"); validate.SelectByText("Tab", "Contacts"); validate.WaitForWorkAround(2000); executionLog.Log("AdminSetValidationDecimal", "Select Section as Contacts"); validate.SelectByText("Section", "Contacts"); validate.WaitForWorkAround(2000); executionLog.Log("AdminSetValidationDecimal", "Click Search"); validate.ClickElement("Search"); validate.WaitForWorkAround(3000); executionLog.Log("AdminSetValidationDecimal", "Type title"); validate.TypeText("filter", "Title"); validate.WaitForWorkAround(3000); executionLog.Log("AdminSetValidationDecimal", "Click TitleField"); validate.ClickElement("ContactTitle"); validate.WaitForWorkAround(4000); executionLog.Log("AdminSetValidationDecimal", "Click ApplyDataTypeValidation"); validate.checkAndClick("ProcApplyDataTypeValidation"); validate.WaitForWorkAround(2000); executionLog.Log("AdminSetValidationDecimal", "Select data type as decimal."); validate.SelectByText("ProcFieldDataType", "Decimal"); validate.WaitForWorkAround(2000); executionLog.Log("AdminSetValidationDecimal", "Click SaveFieldManager"); validate.ClickElement("SaveFieldManager"); validate.WaitForWorkAround(3000); executionLog.Log("AdminSetValidationDecimal", "Redirect at Create Client"); VisitOffice("clients/create"); validate.WaitForWorkAround(3000); executionLog.Log("AdminSetValidationDecimal", "Select Processor"); office_ClientsHelper.SelectByText("CreateProc", "First Data North"); executionLog.Log("AdminSetValidationDecimal", "Enter Client Dba Name"); office_ClientsHelper.TypeText("ClientDBAName", DBAName); executionLog.Log("AdminSetValidationDecimal", "Select client status"); office_ClientsHelper.SelectByText("ClientStatus", "New"); executionLog.Log("AdminSetValidationDecimal", "Select Client Res[onsibility."); office_ClientsHelper.SelectByText("ClientResponsibility", "Howard Tang"); executionLog.Log("AdminSetValidationDecimal", "Click on next button"); office_ClientsHelper.ClickElement("Next"); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("AdminSetValidationDecimal", "Wait for confirmation message."); office_ClientsHelper.WaitForText("Client saved successfully. ", 10); executionLog.Log("AdminSetValidationDecimal", "Click On Contact Tab Clinet"); office_ClientsHelper.ClickElement("ContactDetails"); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("AdminSetValidationDecimal", "Wait "); validate.WaitForElementPresent("Title", 1); validate.WaitForWorkAround(2000); executionLog.Log("AdminSetValidationDecimal", "Redirect To clients page. "); VisitOffice("clients"); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("AdminSetValidationDecimal", "Enter Company Name"); office_ClientsHelper.TypeText("SearchClient", DBAName); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("AdminSetValidationDecimal", "Select client by check box"); office_ClientsHelper.ClickForce("ClickOn1stOpp"); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("AdminSetValidationDecimal", "Click on delete client"); office_ClientsHelper.ClickElement("DeleteClient"); executionLog.Log("AdminSetValidationDecimal", "Accept alert message."); office_ClientsHelper.AcceptAlert(); executionLog.Log("AdminSetValidationDecimal", "Wait for success message."); office_ClientsHelper.WaitForText("1 records deleted successfully", 10); executionLog.Log("AdminSetValidationDecimal", "Redirect To client recycle bin page. "); VisitOffice("clients/recyclebin"); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("AdminSetValidationDecimal", "Enter Company Name"); office_ClientsHelper.TypeText("SearchClient", DBAName); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("AdminSetValidationDecimal", "Click on delete client"); office_ClientsHelper.ClickElement("DeleteRbin"); executionLog.Log("AdminSetValidationDecimal", "Accept alert message."); office_ClientsHelper.AcceptAlert(); executionLog.Log("AdminSetValidationDecimal", "Wait for success message."); office_ClientsHelper.WaitForText("Client Permanently Deleted.", 10); VisitOffice("fields"); validate.WaitForWorkAround(3000); validate.SelectByText("Module", "Clients"); validate.WaitForWorkAround(2000); executionLog.Log("AdminSetValidationDecimal", "Select Processor as First Data North"); validate.SelectByText("Processor", "First Data North"); validate.WaitForWorkAround(2000); executionLog.Log("AdminSetValidationDecimal", "Select Tab as Contacts"); validate.SelectByText("Tab", "Contacts"); validate.WaitForWorkAround(2000); executionLog.Log("AdminSetValidationDecimal", "Select Section as Contacts"); validate.SelectByText("Section", "Contacts"); validate.WaitForWorkAround(2000); executionLog.Log("AdminSetValidationDecimal", "Click Search"); validate.ClickElement("Search"); validate.WaitForWorkAround(3000); executionLog.Log("AdminSetValidationDecimal", "Type title"); validate.TypeText("filter", "Title"); validate.WaitForWorkAround(3000); executionLog.Log("AdminSetValidationDecimal", "Click TitleField"); validate.ClickElement("ContactTitle"); validate.WaitForWorkAround(4000); executionLog.Log("AdminSetValidationDecimal", "Click ApplyDataTypeValidation"); validate.checkAndClick("ProcApplyDataTypeValidation"); validate.WaitForWorkAround(2000); executionLog.Log("AdminSetValidationDecimal", "Click SaveFieldManager"); validate.ClickElement("SaveFieldManager"); validate.WaitForWorkAround(3000); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("AdminSetValidationDecimal"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Admin Set Validation Decimal"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Admin Set Validation Decimal", "Bug", "Medium", "Client page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Admin Set Validation Decimal"); TakeScreenshot("AdminSetFormatSSN"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\AdminSetValidationDecimal.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("AdminSetValidationDecimal"); string id = loginHelper.getIssueID("Admin Set Validation Decimal"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\AdminSetValidationDecimal.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Admin Set Validation Decimal"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Admin Set Validation Decimal"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("AdminSetValidationDecimal"); executionLog.WriteInExcel("Admin Set Validation Decimal", Status, JIRA, "Partner Portal"); } }
public void clientMerchantIssue2() { string[] username = null; string[] password = null; string[] log = null; var oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); username = oXMLData.getData("settings/Credentials", "username_office"); 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 office_ClientsHelper = new Office_ClientsHelper(GetWebDriver()); var DBA = "Client" + RandomNumber(3333, 99999); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("ClientMerchantIssue2", "Login with valid username and password"); Login(username[0], password[0]); executionLog.Log("ClientMerchantIssue2", "Verify Page title"); VerifyTitle("Dashboard"); executionLog.Log("ClientMerchantIssue2", "Go to create a client page"); VisitOffice("clients/create"); executionLog.Log("ClientMerchantIssue2", "Verify title"); VerifyTitle("Create a Client"); executionLog.Log("ClientMerchantIssue2", "Enter Client Dba Name"); office_ClientsHelper.TypeText("ClientDBAName", DBA); executionLog.Log("ClientMerchantIssue2", "Select client status"); office_ClientsHelper.SelectByText("ClientStatus", "New"); executionLog.Log("ClientMerchantIssue2", "Select Client Res[onsibility."); office_ClientsHelper.SelectByText("ClientResponsibility", "Howard Tang"); executionLog.Log("ClientMerchantIssue2", "Click on next button"); office_ClientsHelper.ClickElement("Next"); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("ClientMerchantIssue2", "Wait for confirmation message."); office_ClientsHelper.WaitForText("Client saved successfully. ", 10); executionLog.Log("ClientMerchantIssue2", "Click on 'CustomerRelation' tab"); office_ClientsHelper.ClickElement("CustomerRelationship"); executionLog.Log("ClientMerchantIssue2", "Verify CustomerRelation tab is present"); office_ClientsHelper.verifyElementPresent("CustomerRelationHighlighted"); executionLog.Log("ClientMerchantIssue2", "Verify Terminals tab not present"); office_ClientsHelper.verifyElementNotPresent("TerminalsHighlighted"); executionLog.Log("ClientMerchantIssue2", "Click on Terminals tab"); office_ClientsHelper.ClickElement("TerminalsandEquipments"); executionLog.Log("ClientMerchantIssue2", "Verify Terminals tab is present"); office_ClientsHelper.verifyElementPresent("TerminalsHighlighted"); executionLog.Log("ClientMerchantIssue2", "Verify Products tab not present"); office_ClientsHelper.verifyElementNotPresent("ProductsHighlighted"); executionLog.Log("ClientMerchantIssue2", "Redirect at clients page."); VisitOffice("clients"); executionLog.Log("ClientMerchantIssue2", "Enter Company Name"); office_ClientsHelper.TypeText("SearchClient", DBA); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("ClientMerchantIssue2", "Select client by check box"); office_ClientsHelper.ClickElement("ClickOn1stOpp"); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("ClientMerchantIssue2", "Click on delete client"); office_ClientsHelper.ClickElement("DeleteClient"); executionLog.Log("ClientMerchantIssue2", "Accept alert message."); office_ClientsHelper.AcceptAlert(); executionLog.Log("ClientMerchantIssue2", "Wait for success message."); office_ClientsHelper.WaitForText("1 records deleted successfully", 10); executionLog.Log("ClientMerchantIssue2", "Redirect To client recycle bin page. "); VisitOffice("clients/recyclebin"); executionLog.Log("ClientMerchantIssue2", "Enter Company Name"); office_ClientsHelper.TypeText("SearchClient", DBA); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("ClientMerchantIssue2", "Click on delete client"); office_ClientsHelper.ClickElement("DeleteRbin"); executionLog.Log("ClientMerchantIssue2", "Accept alert message."); office_ClientsHelper.AcceptAlert(); executionLog.Log("ClientMerchantIssue2", "Wait for success message."); office_ClientsHelper.WaitForText("Client Permanently Deleted.", 10); executionLog.Log("ClientMerchantIssue2", "Logout from the application"); VisitOffice("logout"); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("ClientMerchantIssue2"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Client Merchant Issue 2"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Client Merchant Issue 2", "Bug", "Medium", "Client page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Client Merchant Issue 2"); TakeScreenshot("ClientMerchantIssue2"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\ClientMerchantIssue2.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("ClientMerchantIssue2"); string id = loginHelper.getIssueID("Client Merchant Issue 2"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\ClientMerchantIssue2.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Client Merchant Issue 2"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Client Merchant Issue 2"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("ClientMerchantIssue2"); executionLog.WriteInExcel("Client Merchant Issue 2", Status, JIRA, "Client Management"); } }
public void client() { 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 office_ClientsHelper = new Office_ClientsHelper(GetWebDriver()); username = oXMLData.getData("settings/Credentials", "username_office"); password = oXMLData.getData("settings/Credentials", "password"); // Variable var DBA = "Dba" + RandomNumber(99, 999); var DBAQA = "QADBA" + RandomNumber(100, 999); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("Client", "Login with valid credential Username"); Login(username[0], password[0]); executionLog.Log("Client", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("Client", "Goto Create Client"); VisitOffice("clients/create"); executionLog.Log("Client", "Enter Client Dba Name"); office_ClientsHelper.TypeText("ClientDBAName", DBA); executionLog.Log("Client", "Select client status"); office_ClientsHelper.SelectByText("ClientStatus", "New"); executionLog.Log("Client", "Select Client Res[onsibility."); office_ClientsHelper.SelectByText("ClientResponsibility", "Howard Tang"); executionLog.Log("Client", "Click on next button"); office_ClientsHelper.ClickElement("Next"); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("Client", "Wait for confirmation message."); office_ClientsHelper.WaitForText("Client saved successfully. ", 10); executionLog.Log("Client", "Visit Craete Client"); VisitOffice("clients/create"); executionLog.Log("Client", "Click Cancel"); office_ClientsHelper.ClickElement("CancelOpp"); executionLog.Log("Client", "Enter Comp"); office_ClientsHelper.VerifyText("VerifyTextPresentClient", "Merchants"); executionLog.Log("Client", "Visit Craete Client"); VisitOffice("clients/create"); office_ClientsHelper.WaitForWorkAround(4000); executionLog.Log("Client", "Enter Client Dba Name"); office_ClientsHelper.TypeText("ClientDBAName", DBAQA); executionLog.Log("Client", "Select client status"); office_ClientsHelper.SelectByText("ClientStatus", "New"); executionLog.Log("Client", "Select Client Res[onsibility."); office_ClientsHelper.SelectByText("ClientResponsibility", "Howard Tang"); executionLog.Log("Client", "Click on next button"); office_ClientsHelper.ClickElement("Next"); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("Client", "Wait for confirmation message."); office_ClientsHelper.WaitForText("Client saved successfully. ", 10); executionLog.Log("Client", "Wait for element to be visible."); office_ClientsHelper.WaitForElementPresent("CompanyDetails", 10); executionLog.Log("Client", "Goto Company details tab."); office_ClientsHelper.ClickElement("CompanyDetails"); executionLog.Log("Client", "Visit Client"); VisitOffice("clients"); office_ClientsHelper.WaitForWorkAround(4000); executionLog.Log("Client", "Check mark the first"); office_ClientsHelper.ClickElement("ClickOn1stOpp"); office_ClientsHelper.WaitForWorkAround(1000); executionLog.Log("Client", "CheckMark Second"); office_ClientsHelper.ClickElement("ClickOn2ndOpp"); office_ClientsHelper.WaitForWorkAround(1000); executionLog.Log("Client", "Click Merege"); office_ClientsHelper.ClickElement("ClickOnMergeRecords"); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("Client", "Radio select company to merge"); office_ClientsHelper.ClickElement("ClientCompToMrge"); office_ClientsHelper.WaitForWorkAround(1000); executionLog.Log("Client", "Click On Merge"); office_ClientsHelper.ClickElement("ClickOnMergeBtn"); office_ClientsHelper.AcceptAlert(); executionLog.Log("Client", "Wait For Confirmation"); office_ClientsHelper.WaitForText("Merging Client(s) Completed Successfully.", 10); executionLog.Log("Client", "Redirect To clients page. "); VisitOffice("clients"); office_ClientsHelper.WaitForWorkAround(4000); executionLog.Log("Client", "Enter Company Name"); office_ClientsHelper.TypeText("SearchClient", DBA); office_ClientsHelper.WaitForWorkAround(4000); executionLog.Log("Client", "Select client by check box"); office_ClientsHelper.ClickElement("ClickOn1stOpp"); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("Client", "Click on delete client"); office_ClientsHelper.ClickElement("DeleteClient"); executionLog.Log("Client", "Accept alert message."); office_ClientsHelper.AcceptAlert(); executionLog.Log("Client", "Wait for success message."); office_ClientsHelper.WaitForText("1 records deleted successfully", 10); executionLog.Log("Client", "Redirect To client recycle bin page. "); VisitOffice("clients/recyclebin"); office_ClientsHelper.WaitForWorkAround(4000); executionLog.Log("Client", "Enter Company Name"); office_ClientsHelper.TypeText("SearchClient", DBAQA); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("Client", "Click on delete client"); office_ClientsHelper.ClickElement("DeleteRbin"); executionLog.Log("Client", "Accept alert message."); office_ClientsHelper.AcceptAlert(); executionLog.Log("Client", "Wait for success message."); office_ClientsHelper.WaitForText("Client Permanently Deleted.", 10); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("Client"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Client"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Client", "Bug", "Medium", "Client", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Client"); TakeScreenshot("Client"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\Client.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("Client"); string id = loginHelper.getIssueID("Client"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\Client.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Client"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Client"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("Client"); executionLog.WriteInExcel("Client", Status, JIRA, "Client Management"); } }
public void clientVerifyCanadaCountry() { string[] username = null; string[] password = null; var oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); username = 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 office_ClientsHelper = new Office_ClientsHelper(GetWebDriver()); // VARIABLE var DBA = "Client" + RandomNumber(111, 99999); var Title = "Tester" + RandomNumber(11, 100); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("ClientVerifyCanadaCountry", "Login with valid username and password"); Login(username[0], password[0]); executionLog.Log("ClientVerifyCanadaCountry", "Verify Page title"); VerifyTitle("Dashboard"); executionLog.Log("ClientVerifyCanadaCountry", "Redirect to Create Merchant page"); VisitOffice("clients/create"); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("ClientVerifyCanadaCountry", "Enter Client Dba Name"); office_ClientsHelper.TypeText("ClientDBAName", DBA); executionLog.Log("ClientVerifyCanadaCountry", "Select client status"); office_ClientsHelper.SelectByText("ClientStatus", "New"); executionLog.Log("ClientVerifyCanadaCountry", "Select Client Responsibility."); office_ClientsHelper.SelectByText("ClientResponsibility", "Howard Tang"); executionLog.Log("ClientVerifyCanadaCountry", "Click on next button"); office_ClientsHelper.ClickElement("Next"); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("ClientVerifyCanadaCountry", "Wait for confirmation message."); office_ClientsHelper.WaitForText("Client saved successfully. ", 10); executionLog.Log("ClientVerifyCanadaCountry", "Goto Company details tab."); office_ClientsHelper.ClickElement("CompanyDetails"); office_ClientsHelper.WaitForWorkAround(3000); office_ClientsHelper.TypeText("FederalTaxID", "123432232"); //office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("ClientVerifyCanadaCountry", "Select Mailing Country"); office_ClientsHelper.SelectByText("MailingCountry", "Canada"); //office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("ClientVerifyCanadaCountry", "Select Location counrty"); office_ClientsHelper.SelectByText("LocationCountry", "Canada"); //office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("ClientVerifyCanadaCountry", "Click On Contact Tab"); office_ClientsHelper.ClickElement("ContactDetails"); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("ClientVerifyCanadaCountry", "Enter the Contact Title"); office_ClientsHelper.TypeText("ContactTitle", Title); executionLog.Log("ClientVerifyCanadaCountry", "SelectAddressCountry"); office_ClientsHelper.SelectByText("ContactAddressCountry", "Canada"); //office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("ClientVerifyCanadaCountry", "Clkck on Owner tab"); office_ClientsHelper.ClickForce("OwnerTab"); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("ClientVerifyCanadaCountry", "Select Owner Address country"); office_ClientsHelper.SelectByText("OwnerAddressCountry", "Canada"); //office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("ClientVerifyCanadaCountry", "Redirect at clients page."); VisitOffice("clients"); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("ClientVerifyCanadaCountry", "Enter Company Name"); office_ClientsHelper.TypeText("SearchClient", DBA); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("ClientVerifyCanadaCountry", "Select client by check box"); office_ClientsHelper.ClickElement("ClickOn1stOpp"); //office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("ClientVerifyCanadaCountry", "Click on delete client"); office_ClientsHelper.ClickElement("DeleteClient"); executionLog.Log("ClientVerifyCanadaCountry", "Accept alert message."); office_ClientsHelper.AcceptAlert(); executionLog.Log("ClientVerifyCanadaCountry", "Wait for success message."); office_ClientsHelper.WaitForText("1 records deleted successfully", 10); executionLog.Log("ClientVerifyCanadaCountry", "Redirect To client recycle bin page. "); VisitOffice("clients/recyclebin"); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("ClientVerifyCanadaCountry", "Enter Company Name"); office_ClientsHelper.TypeText("SearchClient", DBA); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("ClientVerifyCanadaCountry", "Click on delete client"); office_ClientsHelper.ClickElement("DeleteRbin"); executionLog.Log("ClientVerifyCanadaCountry", "Accept alert message."); office_ClientsHelper.AcceptAlert(); executionLog.Log("ClientVerifyCanadaCountry", "Wait for success message."); office_ClientsHelper.WaitForText("Client Permanently Deleted.", 10); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("ClientVerifyCanadaCountry"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Client Verify Canada Country"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Client Verify Canada Country", "Bug", "Medium", "Client page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Client Verify Canada Country"); TakeScreenshot("ClientVerifyCanadaCountry"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\ClientVerifyCanadaCountry.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("ClientVerifyCanadaCountry"); string id = loginHelper.getIssueID("Client Verify Canada Country"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\ClientVerifyCanadaCountry.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Client Verify Canada Country"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Client Verify Canada Country"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("ClientVerifyCanadaCountry"); executionLog.WriteInExcel("Client Verify Canada Country", Status, JIRA, "Client Management"); } }
public void deleteClientUserRefresh() { string[] username = null; string[] password = null; var oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); username = 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 office_ClientsHelper = new Office_ClientsHelper(GetWebDriver()); var office_ClientUsersHelper = new Office_UserHelper(GetWebDriver()); // Variable var FirstName = "Fname" + RandomNumber(1, 999); var LastName = "Lname" + RandomNumber(1, 999); var Number = "123" + RandomNumber(1, 9999); var DBAName = "DBA" + RandomNumber(1, 999); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("DeleteClientUserRefresh", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("DeleteClientUserRefresh", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("DeleteClientUserRefresh", "Go to create clients page."); VisitOffice("clients/create"); office_ClientsHelper.WaitForWorkAround(1000); executionLog.Log("DeleteClientUserRefresh", "Enter Client Dba Name"); office_ClientsHelper.TypeText("ClientDBAName", DBAName); executionLog.Log("DeleteClientUserRefresh", "Select client status"); office_ClientsHelper.SelectByText("ClientStatus", "New"); executionLog.Log("DeleteClientUserRefresh", "Select Client Res[onsibility."); office_ClientsHelper.SelectByText("ClientResponsibility", "Howard Tang"); executionLog.Log("DeleteClientUserRefresh", "Click on next button"); office_ClientsHelper.ClickElement("Next"); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("DeleteClientUserRefresh", "Wait for confirmation message."); office_ClientsHelper.WaitForText("Client saved successfully. ", 10); executionLog.Log("DeleteClientUserRefresh", "Click on Owner Tab"); office_ClientsHelper.ClickElement("OwnerTab"); office_ClientsHelper.WaitForWorkAround(5000); executionLog.Log("DeleteClientUserRefresh", "Enter First Name"); office_ClientsHelper.TypeText("OwnerFirstName", "Test"); executionLog.Log("DeleteClientUserRefresh", "Enter Last Name"); office_ClientsHelper.TypeText("OwnerLastName", "Tester"); executionLog.Log("DeleteClientUserRefresh", "Enter the title"); office_ClientsHelper.TypeText("TitleOwner", "President"); executionLog.Log("DeleteClientUserRefresh", "Select Phone Type"); office_ClientsHelper.SelectByText("OwnerPhoneType", "Emergency"); executionLog.Log("DeleteClientUserRefresh", "Enter Owner phone no."); office_ClientsHelper.TypeText("OwnerPhoneNumber", "1234567890"); executionLog.Log("DeleteClientUserRefresh", "Select Phone Type"); // office_ClientsHelper.SelectByText("OwnerAddressType", "Home"); executionLog.Log("DeleteClientUserRefresh", "Enter Owner Zip code."); // office_ClientsHelper.TypeText("OwnerZipCode", "60601"); executionLog.Log("DeleteClientUserRefresh", "Select owner eAddress label."); office_ClientsHelper.SelectByText("OwnereAddressType", "E-Mail"); executionLog.Log("DeleteClientUserRefresh", "Select owner eAddress label."); office_ClientsHelper.SelectByText("OwnerEAddressLabel", "Home"); executionLog.Log("DeleteClientUserRefresh", "Enter Owner eAddress"); office_ClientsHelper.TypeText("OwnereAddressEnter", "*****@*****.**"); executionLog.Log("DeleteClientUserRefresh", "Click On Save Btn"); office_ClientsHelper.ClickElement("SaveButtonByTitle"); office_ClientsHelper.WaitForWorkAround(2000); office_ClientsHelper.WaitForText("Client data updated successfully.", 10); executionLog.Log("DeleteClientUserRefresh", "Go tO Client"); VisitOffice("users/client_users"); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("DeleteClientUserRefresh", "Click on create Client User"); office_ClientUsersHelper.ClickElement("CreateClientUser"); office_ClientUsersHelper.WaitForWorkAround(2000); executionLog.Log("DeleteClientUserRefresh", "Enter DBA Name"); office_ClientUsersHelper.TypeText("EnterCompanyNameCU", DBAName); executionLog.Log("DeleteClientUserRefresh", "Click on Search Button"); office_ClientUsersHelper.ClickElement("ClickOnSearchButton"); office_ClientUsersHelper.WaitForWorkAround(4000); executionLog.Log("DeleteClientUserRefresh", "Click on client company name"); office_ClientUsersHelper.ClickElement("ClickDbaname"); office_ClientUsersHelper.WaitForWorkAround(1000); executionLog.Log("DeleteClientUserRefresh", "Client User button"); office_ClientUsersHelper.ClickElement("CreateClientUser1"); executionLog.Log("DeleteClientUserRefresh", "Accept alert message."); office_ClientsHelper.AcceptAlert(); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("DeleteClientUserRefresh", "Close pop up"); office_ClientUsersHelper.ClickElement("ClikCloseCUPOP"); office_ClientUsersHelper.WaitForWorkAround(2000); executionLog.Log("DeleteClientUserRefresh", "Click Refresh"); office_ClientUsersHelper.ClickElement("ClickRefreshCU"); office_ClientUsersHelper.WaitForWorkAround(2000); executionLog.Log("DeleteClientUserRefresh", "Search DBA"); office_ClientUsersHelper.TypeText("SearchClientUSER", DBAName); office_ClientUsersHelper.WaitForWorkAround(2000); executionLog.Log("DeleteClientUserRefresh", "Create Client"); office_ClientUsersHelper.ClickElement("ClickOnTheClientUser"); office_ClientUsersHelper.WaitForWorkAround(1000); executionLog.Log("DeleteClientUserRefresh", "Click on Delete User"); office_ClientUsersHelper.ClickElement("ClickOnDeleteUser"); executionLog.Log("DeleteClientUserRefresh", "Accept alert message."); office_ClientUsersHelper.AcceptAlert(); executionLog.Log("DeleteClientUserRefresh", "Wait for success message."); office_ClientUsersHelper.WaitForText("Client Users", 10); office_ClientUsersHelper.WaitForWorkAround(5000); executionLog.Log("DeleteClientUserRefresh", "Redirect at clients page."); VisitOffice("clients"); executionLog.Log("DeleteClientUserRefresh", "Enter Company Name"); office_ClientsHelper.TypeText("SearchClient", DBAName); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("DeleteClientUserRefresh", "Select client by check box"); office_ClientsHelper.ClickElement("ClickOn1stOpp"); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("DeleteClientUserRefresh", "Click on delete client"); office_ClientsHelper.ClickElement("DeleteClient"); executionLog.Log("DeleteClientUserRefresh", "Accept alert message."); office_ClientsHelper.AcceptAlert(); executionLog.Log("DeleteClientUserRefresh", "Wait for success message."); office_ClientsHelper.WaitForText("1 records deleted successfully", 10); executionLog.Log("DeleteClientUserRefresh", "Redirect To client recycle bin page. "); VisitOffice("clients/recyclebin"); executionLog.Log("DeleteClientUserRefresh", "Enter Company Name"); office_ClientsHelper.TypeText("SearchClient", DBAName); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("DeleteClientUserRefresh", "Select All in responsibilty"); office_ClientsHelper.SelectByText("ClientResponsibityRecycle", "All"); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("DeleteClientUserRefresh", "Click on delete client"); office_ClientsHelper.ClickElement("DeleteRbin"); executionLog.Log("DeleteClientUserRefresh", "Accept alert message."); office_ClientsHelper.AcceptAlert(); executionLog.Log("DeleteClientUserRefresh", "Wait for success message."); office_ClientsHelper.WaitForText("Client Permanently Deleted.", 10); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("DeleteClientUserRefresh"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Delete Client User Refresh"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Delete Client User Refresh", "Bug", "Medium", "Client page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Delete Client User Refresh"); TakeScreenshot("DeleteClientUserRefresh"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\DeleteClientUserRefresh.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("DeleteClientUserRefresh"); string id = loginHelper.getIssueID("Delete Client User Refresh"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\DeleteClientUserRefresh.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Delete Client User Refresh"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Delete Client User Refresh"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("DeleteClientUserRefresh"); executionLog.WriteInExcel("Delete Client User Refresh", Status, JIRA, "Client Management"); } }
public void verifyQuickLookLabelsForClients() { 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 office_ClientsHelper = new Office_ClientsHelper(GetWebDriver()); username = oXMLData.getData("settings/Credentials", "username_office"); password = oXMLData.getData("settings/Credentials", "password"); // Variable var Oppname = "Test" + RandomNumber(99, 99999); var DBA = "New" + RandomNumber(99, 99999); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("VerifyQuickLookLabelsForClients", "Login with valid credential Username"); Login(username[0], password[0]); executionLog.Log("VerifyQuickLookLabelsForClients", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("VerifyQuickLookLabelsForClients", "Goto Create Client"); VisitOffice("clients/create"); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyQuickLookLabelsForClients", "Enter Client Dba Name"); office_ClientsHelper.TypeText("ClientDBAName", DBA); executionLog.Log("VerifyQuickLookLabelsForClients", "Select client status"); office_ClientsHelper.SelectByText("ClientStatus", "New"); executionLog.Log("VerifyQuickLookLabelsForClients", "Select Client Res[onsibility."); office_ClientsHelper.SelectByText("ClientResponsibility", "Howard Tang"); executionLog.Log("VerifyQuickLookLabelsForClients", "Click on next button"); office_ClientsHelper.ClickElement("Next"); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForClients", "Wait for confirmation message."); office_ClientsHelper.WaitForText("Client saved successfully. ", 05); executionLog.Log("VerifyQuickLookLabelsForClients", "Verify label for client type."); office_ClientsHelper.VerifyText("ClientType", "Click to edit"); //office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForClients", "Verify label for status."); office_ClientsHelper.VerifyText("Status1", "New"); //office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForClients", "Verify label for source."); office_ClientsHelper.VerifyText("Source", "Select"); //office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForClients", "Verify label for category"); office_ClientsHelper.VerifyText("Category", "Select"); //office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForClients", "Verify label for responsibility"); office_ClientsHelper.VerifyText("Responsibilityl", "Howard Tang"); //office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForClients", "Verify label for account manager."); office_ClientsHelper.VerifyText("AccountManager", "Select"); //office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForClients", "Verify label for partner agent."); office_ClientsHelper.VerifyText("PartnerAgentl", "Select"); //office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForClients", "Save Button"); office_ClientsHelper.VerifyText("PartnerAssociationl", "Select Partner Association"); //office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForClients", "Save Button"); office_ClientsHelper.VerifyText("SalesManager", "Select"); //office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForClients", "Click on company details tab."); office_ClientsHelper.ClickElement("CompanyDetails"); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForClients", "Enter the Ferderal tax id"); office_ClientsHelper.TypeText("FederalTaxID", "123432232"); //office_ClientsHelper.WaitForWorkAround(3000); //executionLog.Log("VerifyQuickLookLabelsForClients", "Click on assignments."); //office_ClientsHelper.ClickElement("EditAssignments"); //office_ClientsHelper.WaitForWorkAround(3000); //executionLog.Log("VerifyQuickLookLabelsForClients", "Wait for locator to be present."); //office_ClientsHelper.WaitForElementPresent("Clientt", 10); executionLog.Log("VerifyQuickLookLabelsForClients", "Select client type."); office_ClientsHelper.Select("SelectClientT", "Processing"); //office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForClients", "Select client refferal source."); office_ClientsHelper.Select("SelectSource", "Campaign"); //office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForClients", "Select client category."); office_ClientsHelper.SelectByText("SelectCategory", "Other"); //office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForClients", "Select account manager."); office_ClientsHelper.SelectByText("SelectAcc.Mger", "Howard Tang"); //office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForClients", "Select client user group."); office_ClientsHelper.SelectByText("Ugroup", "Primary Group"); //office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForClients", "Select sales manager."); office_ClientsHelper.SelectByText("SelectSalesManager", "Howard Tang"); //office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForClients", "Select client responsibility"); office_ClientsHelper.SelectByText("ClientResponsibility", "Howard Tang"); //office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForClients", "Select partner agent."); office_ClientsHelper.SelectByText("ClientPartnerAgent", "Mark Menu"); //office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForClients", "Select partner association."); office_ClientsHelper.SelectByText("ClientPartnerAssociation", "Aslam Associate"); //office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForClients", "click on save client"); office_ClientsHelper.ClickElement("SaveButtonByTitle"); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForClients", "click on info tab."); office_ClientsHelper.ClickElement("InfoTab"); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForClients", "Verify label for client type."); office_ClientsHelper.VerifyText("ClientType", "Processing"); //office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForClients", "Verify label for status."); office_ClientsHelper.VerifyText("Status1", "New"); //office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForClients", "Verify label for source."); office_ClientsHelper.VerifyText("Source", "Campaign"); //office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForClients", "Verify label for category."); office_ClientsHelper.VerifyText("Category", "Other"); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForClients", "Verify label for responsibility."); office_ClientsHelper.VerifyText("Responsibilityl", "Howard Tang"); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForClients", "Verify label for account manager."); office_ClientsHelper.VerifyText("AccountManager", "Howard Tang"); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForClients", "Verify label for partner agent."); office_ClientsHelper.VerifyText("PartnerAgentl", "Mark Menu"); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForClients", "Verify label for partner association."); office_ClientsHelper.VerifyText("PartnerAssociationl", "Aslam Associate"); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForClients", "Verify label for partner association."); office_ClientsHelper.VerifyText("SalesManager", "Howard Tang"); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForClients", "Redirect To clients page. "); VisitOffice("clients"); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForClients", "Enter Company Name"); office_ClientsHelper.TypeText("SearchClient", DBA); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyQuickLookLabelsForClients", "Select client by check box"); office_ClientsHelper.ClickElement("ClickOn1stOpp"); //office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyQuickLookLabelsForClients", "Click on delete client"); office_ClientsHelper.ClickElement("DeleteClient"); executionLog.Log("VerifyQuickLookLabelsForClients", "Accept alert message."); office_ClientsHelper.AcceptAlert(); executionLog.Log("VerifyQuickLookLabelsForClients", "Wait for success message."); office_ClientsHelper.WaitForText("1 records deleted successfully", 10); executionLog.Log("VerifyQuickLookLabelsForClients", "Redirect To client recycle bin page. "); VisitOffice("clients/recyclebin"); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForClients", "Enter Company Name"); office_ClientsHelper.TypeText("SearchClient", DBA); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyQuickLookLabelsForClients", "Selcet All in responsibility field"); office_ClientsHelper.SelectByText("ClientResponsibityRecycle", "All"); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyQuickLookLabelsForClients", "Click on delete client"); office_ClientsHelper.ClickElement("DeleteRbin"); executionLog.Log("VerifyQuickLookLabelsForClients", "Accept alert message."); office_ClientsHelper.AcceptAlert(); executionLog.Log("VerifyQuickLookLabelsForClients", "Wait for success message."); office_ClientsHelper.WaitForText("Client Permanently Deleted.", 10); VisitOffice("logout"); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("VerifyQuickLookLabelsForClients"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("VerifyQuickLookLabelsForClients"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Opportunities", "Bug", "Medium", "Clients page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("VerifyQuickLookLabelsForClients"); TakeScreenshot("VerifyQuickLookLabelsForClients"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyQuickLookLabelsForClients.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("VerifyQuickLookLabelsForClients"); string id = loginHelper.getIssueID("VerifyQuickLookLabelsForClients"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyQuickLookLabelsForClients.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("VerifyQuickLookLabelsForClients"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("VerifyQuickLookLabelsForClients"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("VerifyQuickLookLabelsForClients"); executionLog.WriteInExcel("VerifyQuickLookLabelsForClients", Status, JIRA, "Client management"); } }
public void saleAgent1() { string[] username = null; string[] password = null; var oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); // Initializing the objects5 var executionLog = new ExecutionLog(); var loginHelper = new LoginHelper(GetWebDriver()); var agent_1099SalesAgentHelper = new Agent_1099SalesAgentHelper(GetWebDriver()); var office_LeadsHelper = new Office_LeadsHelper(GetWebDriver()); var office_ClientsHelper = new Office_ClientsHelper(GetWebDriver()); username = oXMLData.getData("settings/Credentials", "usernameSale"); password = oXMLData.getData("settings/Credentials", "PasswordSale"); // Variable var FName = "Test" + RandomNumber(99, 99999); var LName = "Test" + RandomNumber(99, 99999); var CDBA = "New" + RandomNumber(99, 99999); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("SaleAgent1", "Login with valid credential Username"); Login(username[0], password[0]); executionLog.Log("SaleAgent1", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("SaleAgent1", "Redirect at Create Lead"); VisitOffice("leads/create"); agent_1099SalesAgentHelper.WaitForWorkAround(3000); executionLog.Log("SaleAgent1", "Click on Save"); agent_1099SalesAgentHelper.ClickElement("ClickSaveBtn"); executionLog.Log("SaleAgent1", "Enter First Name"); agent_1099SalesAgentHelper.TypeText("EnterFirstName", FName); executionLog.Log("SaleAgent1", "Enter Last Name"); agent_1099SalesAgentHelper.TypeText("EnterLastName", LName); executionLog.Log("SaleAgent1", "Company DBA Name"); agent_1099SalesAgentHelper.TypeText("LeadCompanyName", CDBA); executionLog.Log("SaleAgent1", "Select Lead Status"); agent_1099SalesAgentHelper.SelectByText("SelectLeadStatus", "New"); executionLog.Log("SaleAgent1", "Select Responsibilities"); agent_1099SalesAgentHelper.SelectByText("SelectResponsibities", "Howard Tang"); executionLog.Log("SaleAgent1", "Click Save button"); agent_1099SalesAgentHelper.ClickElement("ClickSaveBtn"); agent_1099SalesAgentHelper.WaitForWorkAround(3000); var loc = "//h3[text()='Existing Leads']"; if (agent_1099SalesAgentHelper.IsElementPresent(loc)) { executionLog.Log("SaleAgent1", "Lead Dublicate button"); agent_1099SalesAgentHelper.ClickOnDisplayed("CraeteLeadDub"); agent_1099SalesAgentHelper.WaitForText("Lead saved successfully.", 10); } else { executionLog.Log("SaleAgent1", "Lead Saved confirmation"); agent_1099SalesAgentHelper.WaitForText("Lead saved successfully.", 10); executionLog.Log("SaleAgent1", "Redirect at Create Lead"); VisitOffice("leads/create"); agent_1099SalesAgentHelper.WaitForWorkAround(3000); executionLog.Log("SaleAgent1", "Click on Cancel"); agent_1099SalesAgentHelper.ClickElement("CancelOpp"); agent_1099SalesAgentHelper.WaitForWorkAround(3000); executionLog.Log("SaleAgent1", "Verify page title."); agent_1099SalesAgentHelper.VerifyText("VerifyTextPresentLead", "Leads"); executionLog.Log("SaleAgent1", "Redirect at Create Lead"); VisitOffice("leads/create"); agent_1099SalesAgentHelper.WaitForWorkAround(3000); executionLog.Log("SaleAgent1", "Click Save button"); agent_1099SalesAgentHelper.ClickElement("ClickSaveBtn"); //agent_1099SalesAgentHelper.WaitForWorkAround(3000); executionLog.Log("SaleAgent1", "Enter First Name"); agent_1099SalesAgentHelper.TypeText("EnterFirstName", FName); executionLog.Log("SaleAgent1", "Enter Last Name"); agent_1099SalesAgentHelper.TypeText("EnterLastName", LName); executionLog.Log("SaleAgent1", "Lead Company DBA Name"); agent_1099SalesAgentHelper.TypeText("LeadCompanyName", CDBA); executionLog.Log("SaleAgent1", "Select Lead Status"); agent_1099SalesAgentHelper.SelectByText("SelectLeadStatus", "New"); executionLog.Log("SaleAgent1", "Select Responsibities"); agent_1099SalesAgentHelper.SelectByText("SelectResponsibities", "Howard Tang"); executionLog.Log("SaleAgent1", "Click Save button"); agent_1099SalesAgentHelper.ClickElement("ClickSaveBtn"); agent_1099SalesAgentHelper.WaitForWorkAround(3000); } if (agent_1099SalesAgentHelper.IsElementPresent(loc)) { executionLog.Log("SaleAgent1", "Click on Lead Dublicate button"); agent_1099SalesAgentHelper.ClickOnDisplayed("CraeteLeadDub"); agent_1099SalesAgentHelper.WaitForWorkAround(4000); executionLog.Log("SaleAgent1", "Goto Lead Page"); VisitOffice("leads"); agent_1099SalesAgentHelper.WaitForWorkAround(4000); executionLog.Log("SaleAgent1", "Select First Lead"); agent_1099SalesAgentHelper.ClickElement("ClickOn1stOpp"); executionLog.Log("SaleAgent1", "Select Second Lead"); agent_1099SalesAgentHelper.ClickElement("ClickOn2ndOpp"); executionLog.Log("SaleAgent1", "Click on Merge"); agent_1099SalesAgentHelper.ClickElement("ClickOnMergeRecords"); agent_1099SalesAgentHelper.WaitForWorkAround(3000); executionLog.Log("SaleAgent1", "Click on Lead Company Radio Button"); agent_1099SalesAgentHelper.ClickElement("LeadCompyRadioBtn"); agent_1099SalesAgentHelper.WaitForWorkAround(1000); executionLog.Log("SaleAgent1", "Click Merge Button"); agent_1099SalesAgentHelper.ClickElement("ClickOnMergeBtn"); agent_1099SalesAgentHelper.AcceptAlert(); executionLog.Log("SaleAgent1", "Confirmation Merge Successfull"); agent_1099SalesAgentHelper.WaitForText("Merging Lead(s) Completed Successfully.", 10); executionLog.Log("SaleAgent1", "Redirect To leads page. "); VisitOffice("leads"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("SaleAgent1", "Select lead by check box"); office_LeadsHelper.ClickElement("ClickOn1stOpp"); //office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("SaleAgent1", "Click on delete lead"); office_LeadsHelper.ClickElement("DeleteLead"); executionLog.Log("SaleAgent1", "Accept alert message."); office_LeadsHelper.AcceptAlert(); executionLog.Log("SaleAgent1", "Wait for success message."); office_LeadsHelper.WaitForText("1 records deleted successfully", 10); executionLog.Log("SaleAgent1", "Redirect To leads recycle bin page. "); VisitOffice("leads/recyclebin"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("SaleAgent1", "Click on delete leads"); office_LeadsHelper.ClickElement("DeleteRbin"); executionLog.Log("SaleAgent1", "Accept alert message."); office_LeadsHelper.AcceptAlert(); executionLog.Log("SaleAgent1", "Wait for success message."); office_LeadsHelper.WaitForText("Lead Permanently Deleted.", 10); } else { executionLog.Log("SaleAgent1", "Lead Saved Successfully"); agent_1099SalesAgentHelper.WaitForText("Lead saved successfully.", 10); executionLog.Log("SaleAgent1", "Go to lead"); VisitOffice("leads"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("SaleAgent1", "Select First Lead"); agent_1099SalesAgentHelper.ClickElement("ClickOn1stOpp"); executionLog.Log("SaleAgent1", "Select Second Lead"); agent_1099SalesAgentHelper.ClickElement("ClickOn2ndOpp"); executionLog.Log("SaleAgent1", "Click Merge Record"); agent_1099SalesAgentHelper.ClickElement("ClickOnMergeRecords"); agent_1099SalesAgentHelper.WaitForWorkAround(3000); executionLog.Log("SaleAgent1", "Select Lead Company Radio Button"); agent_1099SalesAgentHelper.ClickElement("LeadCompyRadioBtn"); agent_1099SalesAgentHelper.WaitForWorkAround(1000); executionLog.Log("SaleAgent1", "Click Merge Button Pop up"); agent_1099SalesAgentHelper.ClickElement("ClickOnMergeBtn"); agent_1099SalesAgentHelper.AcceptAlert(); executionLog.Log("SaleAgent1", "Confirmation Merge Successfull"); agent_1099SalesAgentHelper.WaitForText("Merging Lead(s) Completed Successfully.", 10); executionLog.Log("SaleAgent1", "Redirect To leads page. "); VisitOffice("leads"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("SaleAgent1", "Select lead by check box"); office_LeadsHelper.ClickElement("ClickOn1stOpp"); //office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("SaleAgent1", "Click on delete lead"); office_LeadsHelper.ClickElement("DeleteLead"); executionLog.Log("SaleAgent1", "Accept alert message."); office_LeadsHelper.AcceptAlert(); executionLog.Log("SaleAgent1", "Wait for success message."); office_LeadsHelper.WaitForText("1 records deleted successfully", 10); executionLog.Log("SaleAgent1", "Redirect To leads recycle bin page. "); VisitOffice("leads/recyclebin"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("SaleAgent1", "Click on delete leads"); office_LeadsHelper.ClickElement("DeleteRbin"); executionLog.Log("SaleAgent1", "Accept alert message."); office_LeadsHelper.AcceptAlert(); executionLog.Log("SaleAgent1", "Wait for success message."); office_LeadsHelper.WaitForText("Lead Permanently Deleted.", 10); } executionLog.Log("SaleAgent1", "Goto Create Client"); VisitOffice("clients/create"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("SaleAgent1", "Click on Save Button"); agent_1099SalesAgentHelper.ClickElement("ClickSaveBtn"); executionLog.Log("SaleAgent1", "Enter DBA name."); agent_1099SalesAgentHelper.TypeText("ClientCompDBA", FName); //executionLog.Log("SaleAgent1", "Enter Client Bussiness Legal Name."); //office_ClientsHelper.TypeText("BussinessLegalName", "LegalCli"); executionLog.Log("SaleAgent1", "Client Status"); agent_1099SalesAgentHelper.SelectByText("ClientStatus", "New"); executionLog.Log("SaleAgent1", "Select Client Responsibility"); agent_1099SalesAgentHelper.SelectByText("SelectClientResponsibility", "Aslam Sales"); executionLog.Log("SaleAgent1", "Click on Save Button"); agent_1099SalesAgentHelper.ClickElement("ClickSaveBtn"); agent_1099SalesAgentHelper.WaitForWorkAround(2000); executionLog.Log("SaleAgent1", "Confirmation for the save"); agent_1099SalesAgentHelper.WaitForText("Client saved successfully.", 10); executionLog.Log("SaleAgent1", "Visit Craete Client"); VisitOffice("clients/create"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("SaleAgent1", "Click on Cancel"); agent_1099SalesAgentHelper.ClickElement("CancelOpp"); agent_1099SalesAgentHelper.WaitForWorkAround(3000); //executionLog.Log("SaleAgent1", "Verify text on page."); //agent_1099SalesAgentHelper.VerifyText("VerifyTextPresentClient", "Clients"); executionLog.Log("SaleAgent1", "Visit Craete Client"); VisitOffice("clients/create"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("SaleAgent1", "Click on Save"); agent_1099SalesAgentHelper.ClickElement("ClickSaveBtn"); executionLog.Log("SaleAgent1", "Client Company DBA Name"); agent_1099SalesAgentHelper.TypeText("ClientCompDBA", FName); //executionLog.Log("SaleAgent1", "Enter Client Bussiness Legal Name."); //office_ClientsHelper.TypeText("BussinessLegalName", "LegalCli"); executionLog.Log("SaleAgent1", "Select Status"); agent_1099SalesAgentHelper.SelectByText("ClientStatus", "New"); executionLog.Log("SaleAgent1", "Select Responsibilties"); agent_1099SalesAgentHelper.SelectByText("SelectClientResponsibility", "Aslam Sales"); executionLog.Log("SaleAgent1", "Click on Save"); agent_1099SalesAgentHelper.ClickElement("ClickSaveBtn"); agent_1099SalesAgentHelper.WaitForWorkAround(2000); executionLog.Log("SaleAgent1", "Wait for Confirmation"); agent_1099SalesAgentHelper.WaitForText("Client saved successfully.", 10); executionLog.Log("SaleAgent1", "Visit Client"); VisitOffice("clients"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("SaleAgent1", "Select first client."); agent_1099SalesAgentHelper.ClickElement("ClickOn1stOpp"); executionLog.Log("SaleAgent1", "Select second client."); agent_1099SalesAgentHelper.ClickElement("ClickOn2ndOpp"); executionLog.Log("SaleAgent1", "Click on merge records."); agent_1099SalesAgentHelper.ClickElement("ClickOnMergeRecords"); agent_1099SalesAgentHelper.WaitForWorkAround(3000); executionLog.Log("SaleAgent1", "Radio select company to merge"); agent_1099SalesAgentHelper.ClickElement("ClientCompToMrge"); agent_1099SalesAgentHelper.WaitForWorkAround(1000); executionLog.Log("SaleAgent1", "Click On Merge"); agent_1099SalesAgentHelper.ClickElement("ClickOnMergeBtn"); agent_1099SalesAgentHelper.AcceptAlert(); executionLog.Log("SaleAgent1", "Wait For Confirmation"); agent_1099SalesAgentHelper.WaitForText("Merging Client(s) Completed Successfully.", 10); executionLog.Log("SaleAgent1", "Redirect To clients page. "); VisitOffice("clients"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("SaleAgent1", "Enter Company Name"); office_ClientsHelper.TypeText("SearchClient", FName); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("SaleAgent1", "Select client by check box"); office_ClientsHelper.ClickElement("ClickOn1stOpp"); //office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("SaleAgent1", "Click on delete client"); office_ClientsHelper.ClickElement("DeleteClient"); executionLog.Log("SaleAgent1", "Accept alert message."); office_ClientsHelper.AcceptAlert(); executionLog.Log("SaleAgent1", "Redirect To client recycle bin page. "); VisitOffice("clients/recyclebin"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("SaleAgent1", "Enter Company Name"); office_ClientsHelper.TypeText("SearchClient", FName); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("SaleAgent1", "Click on delete client"); office_ClientsHelper.ClickElement("DeleteRbin"); executionLog.Log("SaleAgent1", "Accept alert message."); office_ClientsHelper.AcceptAlert(); executionLog.Log("SaleAgent1", "Wait for success message."); office_ClientsHelper.WaitForText("Client Permanently Deleted.", 10); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("SaleAgent1"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("SaleAgent1"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("SaleAgent1", "Bug", "Medium", "Client/Laead Page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("SaleAgent1"); TakeScreenshot("SaleAgent1"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\Iframe.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("SaleAgent1"); string id = loginHelper.getIssueID("SaleAgent1"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\SaleAgent1.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("SaleAgent1"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("SaleAgent1"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("SaleAgent1"); executionLog.WriteInExcel("SaleAgent1", Status, JIRA, "SaleAgent Portal"); } }
public void clientZipCodeAutoPopulationIssue() { 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 office_LeadsHelper = new Office_LeadsHelper(GetWebDriver()); var office_ClientsHelper = new Office_ClientsHelper(GetWebDriver()); username = oXMLData.getData("settings/Credentials", "username_office"); password = oXMLData.getData("settings/Credentials", "password"); // Variable var FName = "Test" + RandomNumber(99, 99999); var LName = "Test" + RandomNumber(99, 99999); var DBA = "New" + RandomNumber(99, 99999); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("ClientZipCodeAutoPopulationIssue", "Login with valid credentials"); Login(username[0], password[0]); executionLog.Log("ClientZipCodeAutoPopulationIssue", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("ClientZipCodeAutoPopulationIssue", "Visit Craete Client"); VisitOffice("clients/create"); office_ClientsHelper.WaitForWorkAround(4000); executionLog.Log("ClientZipCodeAutoPopulationIssue", "Click Cancel"); office_ClientsHelper.ClickForce("CancelOpp"); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("ClientZipCodeAutoPopulationIssue", "Visit Craete Client"); VisitOffice("clients/create"); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("ClientZipCodeAutoPopulationIssue", "Enter Client Dba Name"); office_ClientsHelper.TypeText("ClientDBAName", "Client DBA"); executionLog.Log("ClientZipCodeAutoPopulationIssue", "Select client status"); office_ClientsHelper.SelectByText("ClientStatus", "New"); executionLog.Log("ClientZipCodeAutoPopulationIssue", "Select Client Res[onsibility."); office_ClientsHelper.SelectByText("ClientResponsibility", "Howard Tang"); executionLog.Log("ClientZipCodeAutoPopulationIssue", "Click on next button"); office_ClientsHelper.ClickElement("Next"); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("ClientZipCodeAutoPopulationIssue", "Wait for confirmation message."); office_ClientsHelper.WaitForText("Client saved successfully. ", 10); executionLog.Log("ClientZipCodeAutoPopulationIssue", "Wait for element to be visible."); office_ClientsHelper.WaitForElementPresent("CompanyDetails", 10); executionLog.Log("ClientZipCodeAutoPopulationIssue", "Goto Company details tab."); office_ClientsHelper.ClickElement("CompanyDetails"); executionLog.Log("ClientZipCodeAutoPopulationIssue", "Client Company DBA Name"); office_ClientsHelper.TypeText("ClientDBAName", DBA); executionLog.Log("ClientZipCodeAutoPopulationIssue", "Enter Client federal tax id."); office_ClientsHelper.TypeText("FederalTaxID", "111122222"); executionLog.Log("ClientZipCodeAutoPopulationIssue", "Enter Client Bussiness Legal Name."); office_ClientsHelper.TypeText("BussinessLegalName", "LegalCli"); executionLog.Log("ClientZipCodeAutoPopulationIssue", "Select Status"); office_ClientsHelper.SelectByText("ClientStatus", "New"); executionLog.Log("ClientZipCodeAutoPopulationIssue", "Select Responsibilties"); office_ClientsHelper.SelectByText("ClientResponsibility", "Howard Tang"); executionLog.Log("ClientZipCodeAutoPopulationIssue", "Enter company details zipcode."); office_ClientsHelper.TypeText("ZipCodeMailingAddress", "60601"); office_ClientsHelper.WaitForWorkAround(5000); executionLog.Log("ClientZipCodeAutoPopulationIssue", "Click on contact tab"); office_ClientsHelper.ClickElement("ClickOnContactTab"); executionLog.Log("ClientZipCodeAutoPopulationIssue", "Enter the Conatct Title"); office_ClientsHelper.TypeText("ContactTitle", "(785) 786-8768"); executionLog.Log("ClientZipCodeAutoPopulationIssue", "Click on owner tab."); office_ClientsHelper.ClickForce("OwnerTab"); office_ClientsHelper.WaitForWorkAround(5000); executionLog.Log("ClientZipCodeAutoPopulationIssue", "Enter zip code."); office_ClientsHelper.TypeText("OwnerZipCode", "60601"); office_ClientsHelper.WaitForWorkAround(5000); executionLog.Log("ClientZipCodeAutoPopulationIssue", "Click on save button."); office_ClientsHelper.ClickElement("OwnerSave"); executionLog.Log("ClientZipCodeAutoPopulationIssue", "Wait for confirmation message."); office_ClientsHelper.WaitForText("Client data updated successfully. ", 10); executionLog.Log("ClientZipCodeAutoPopulationIssue", "Visit Client page."); VisitOffice("clients"); executionLog.Log("ClientZipCodeAutoPopulationIssue", "Verify page title."); VerifyTitle(); executionLog.Log("ClientZipCodeAutoPopulationIssue", "Enter created client company name."); office_ClientsHelper.TypeText("SearchClient", DBA); office_ClientsHelper.WaitForWorkAround(6000); executionLog.Log("ClientZipCodeAutoPopulationIssue", "Click on searched company name."); office_ClientsHelper.ClickElement("Client1"); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("ClientZipCodeAutoPopulationIssue", "Click on comapany details tab."); office_ClientsHelper.ClickElement("CompanyDetails"); office_ClientsHelper.WaitForWorkAround(5000); executionLog.Log("ClientZipCodeAutoPopulationIssue", "Verify all field populated automatically on entering a valid zip code."); office_ClientsHelper.VerifyAutoPopulation(); executionLog.Log("ClientZipCodeAutoPopulationIssue", "Click on save button."); office_ClientsHelper.ClickElement("Save"); office_ClientsHelper.WaitForWorkAround(4000); executionLog.Log("ClientZipCodeAutoPopulationIssue", "Redirect at clients page."); VisitOffice("clients"); executionLog.Log("ClientZipCodeAutoPopulationIssue", "Enter Company Name"); office_ClientsHelper.TypeText("SearchClient", DBA); office_ClientsHelper.WaitForWorkAround(5000); executionLog.Log("ClientZipCodeAutoPopulationIssue", "Select client by check box"); office_ClientsHelper.ClickElement("ClickOn1stOpp"); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("ClientZipCodeAutoPopulationIssue", "Click on delete client"); office_ClientsHelper.ClickElement("DeleteClient"); executionLog.Log("ClientZipCodeAutoPopulationIssue", "Accept alert message."); office_ClientsHelper.AcceptAlert(); executionLog.Log("ClientZipCodeAutoPopulationIssue", "Wait for success message."); office_ClientsHelper.WaitForText("1 records deleted successfully", 10); executionLog.Log("ClientZipCodeAutoPopulationIssue", "Redirect To client recycle bin page. "); VisitOffice("clients/recyclebin"); executionLog.Log("ClientZipCodeAutoPopulationIssue", "Enter Company Name"); office_ClientsHelper.TypeText("SearchClient", DBA); office_ClientsHelper.WaitForWorkAround(2000); office_ClientsHelper.selectOwner("//*[@id='gs_first_name']"); office_ClientsHelper.WaitForWorkAround(4000); executionLog.Log("ClientZipCodeAutoPopulationIssue", "Click on delete client"); office_ClientsHelper.ClickElement("DeleteRbin"); executionLog.Log("ClientZipCodeAutoPopulationIssue", "Accept alert message."); office_ClientsHelper.AcceptAlert(); executionLog.Log("ClientZipCodeAutoPopulationIssue", "Wait for success message."); office_ClientsHelper.WaitForText("Client Permanently Deleted.", 10); VisitOffice("logout"); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("ClientZipCodeAutoPopulationIssue"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("ClientZipCodeAutoPopulationIssue"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("ClientZipCodeAutoPopulationIssue", "Bug", "Medium", "Leads page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("ClientZipCodeAutoPopulationIssue"); TakeScreenshot("ClientZipCodeAutoPopulationIssue"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\ClientZipCodeAutoPopulationIssue.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("ClientZipCodeAutoPopulationIssue"); string id = loginHelper.getIssueID("ClientZipCodeAutoPopulationIssue"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\ClientZipCodeAutoPopulationIssue.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("ClientZipCodeAutoPopulationIssue"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("ClientZipCodeAutoPopulationIssue"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("ClientZipCodeAutoPopulationIssue"); executionLog.WriteInExcel("ClientZipCodeAutoPopulationIssue", Status, JIRA, "Lead Management"); } }
public void businessBankingAccountAddAnotherIssue() { string[] username = null; string[] password = null; var oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); username = 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 office_ClientsHelper = new Office_ClientsHelper(GetWebDriver()); // Variable var DBA = "Client" + RandomNumber(1222, 99999); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("BusinessBankingAccountAddAnotherIssue", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("BusinessBankingAccountAddAnotherIssue", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("BusinessBankingAccountAddAnotherIssue", " Reditect at Create Client page."); VisitOffice("clients/create"); executionLog.Log("BusinessBankingAccountAddAnotherIssue", "Verify page title"); VerifyTitleMerchantClient(); executionLog.Log("BusinessBankingAccountAddAnotherIssue", "Enter Client Dba Name"); office_ClientsHelper.TypeText("ClientDBAName", DBA); executionLog.Log("BusinessBankingAccountAddAnotherIssue", "Select client status"); office_ClientsHelper.SelectByText("ClientStatus", "New"); executionLog.Log("BusinessBankingAccountAddAnotherIssue", "Select Client Res[onsibility."); office_ClientsHelper.SelectByText("ClientResponsibility", "Howard Tang"); //office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("BusinessBankingAccountAddAnotherIssue", "Verify label for merchant number text box."); office_ClientsHelper.IsElementPresent("LabelMerchantNumber"); //office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("BusinessBankingAccountAddAnotherIssue", "Verify presence of merchant number text box."); office_ClientsHelper.IsElementVisible("//*[@id='ClientDetailMerchID']"); //office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("BusinessBankingAccountAddAnotherIssue", "Click on next button"); office_ClientsHelper.ClickElement("Next"); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("BusinessBankingAccountAddAnotherIssue", "Wait for confirmation message."); office_ClientsHelper.WaitForText("Client saved successfully. ", 10); executionLog.Log("BusinessBankingAccountAddAnotherIssue", "Click on business details tab."); office_ClientsHelper.ClickElement("BusinessDetailsTab"); executionLog.Log("BusinessBankingAccountAddAnotherIssue", "Verify added contact name for bussiness banking not present on the page."); office_ClientsHelper.IsElementNotPresent("AddedContNAme"); executionLog.Log("BusinessBankingAccountAddAnotherIssue", "Verify added contact phone for bussiness banking not present on the page."); office_ClientsHelper.IsElementNotPresent("AddedContPhone"); executionLog.Log("BusinessBankingAccountAddAnotherIssue", "Verify added bank name for bussiness banking not present on the page."); office_ClientsHelper.IsElementNotPresent("AddedBankName"); executionLog.Log("BusinessBankingAccountAddAnotherIssue", "Verify added routing no. for bussiness banking not present on the page."); office_ClientsHelper.IsElementNotPresent("AddedRoutingNo"); executionLog.Log("BusinessBankingAccountAddAnotherIssue", "Verify added account number for bussiness banking not present on the page."); office_ClientsHelper.IsElementNotPresent("AddedAccounNo"); executionLog.Log("BusinessBankingAccountAddAnotherIssue", "Wait for element to be present."); office_ClientsHelper.WaitForElementPresent("AddAnother", 3); executionLog.Log("BusinessBankingAccountAddAnotherIssue", "Click on Add another button to add second bankin details."); office_ClientsHelper.scrollToElement("AddAnother"); office_ClientsHelper.ClickElement("AddAnother"); executionLog.Log("BusinessBankingAccountAddAnotherIssue", "Verifies added banking details cont. name present on the page."); office_ClientsHelper.VerifyElementDisplayed("AddedContNAme"); executionLog.Log("BusinessBankingAccountAddAnotherIssue", "Verifies added banking details cont. phone present on the page."); office_ClientsHelper.VerifyElementDisplayed("AddedContPhone"); executionLog.Log("BusinessBankingAccountAddAnotherIssue", "Verifies added banking details bank name present on the page."); office_ClientsHelper.VerifyElementDisplayed("AddedBankName"); executionLog.Log("BusinessBankingAccountAddAnotherIssue", "Verifies added banking details routing number present on the page."); office_ClientsHelper.VerifyElementDisplayed("AddedRoutingNo."); executionLog.Log("BusinessBankingAccountAddAnotherIssue", "Verifies added banking details Account number present on the page."); office_ClientsHelper.VerifyElementDisplayed("AddedAccounNo"); executionLog.Log("BusinessBankingAccountAddAnotherIssue", "Redirect at clients page."); VisitOffice("clients"); executionLog.Log("BusinessBankingAccountAddAnotherIssue", "Enter Company Name"); office_ClientsHelper.TypeText("SearchClient", DBA); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("BusinessBankingAccountAddAnotherIssue", "Select client by check box"); office_ClientsHelper.ClickElement("ClickOn1stOpp"); //office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("BusinessBankingAccountAddAnotherIssue", "Click on delete client"); office_ClientsHelper.ClickElement("DeleteClient"); executionLog.Log("BusinessBankingAccountAddAnotherIssue", "Accept alert message."); office_ClientsHelper.AcceptAlert(); executionLog.Log("BusinessBankingAccountAddAnotherIssue", "Wait for success message."); office_ClientsHelper.WaitForText("1 records deleted successfully", 10); executionLog.Log("BusinessBankingAccountAddAnotherIssue", "Redirect To client recycle bin page. "); VisitOffice("clients/recyclebin"); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("BusinessBankingAccountAddAnotherIssue", "Enter Company Name"); office_ClientsHelper.TypeText("SearchClient", DBA); office_ClientsHelper.WaitForWorkAround(2000); office_ClientsHelper.selectOwner("//*[@id='gs_first_name']"); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("BusinessBankingAccountAddAnotherIssue", "Click on delete client"); office_ClientsHelper.ClickElement("DeleteRbin"); executionLog.Log("BusinessBankingAccountAddAnotherIssue", "Accept alert message."); office_ClientsHelper.AcceptAlert(); executionLog.Log("BusinessBankingAccountAddAnotherIssue", "Wait for success message."); office_ClientsHelper.WaitForText("Client Permanently Deleted.", 10); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("BusinessBankingAccountAddAnotherIssue"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Business Banking Account Add Another Issue"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Business Banking Account Add Another Issue", "Bug", "Medium", "Client page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Business Banking Account Add Another Issue"); TakeScreenshot("BusinessBankingAccountAddAnotherIssue"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\BusinessBankingAccountAddAnotherIssue.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("BusinessBankingAccountAddAnotherIssue"); string id = loginHelper.getIssueID("Business Banking Account Add Another Issue"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\BusinessBankingAccountAddAnotherIssue.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Business Banking Account Add Another Issue"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Business Banking Account Add Another Issue"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("BusinessBankingAccountAddAnotherIssue"); executionLog.WriteInExcel("Business Banking Account Add Another Issue", Status, JIRA, "Client Management"); } }
public void bulkUpdateSalesManagerForClient() { string[] username = null; string[] password = null; var oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); username = 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 Office_ClientsHelper = new Office_ClientsHelper(GetWebDriver()); // Variable var FirstName = "Test" + GetRandomNumber(); var LastName = "Tester" + GetRandomNumber(); var Number = "12345678" + GetRandomNumber(); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("BulkUpdateSalesManagerForClient", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("BulkUpdateSalesManagerForClient", "Verify Page title"); VerifyTitle("Dashboard"); executionLog.Log("BulkUpdateSalesManagerForClient", "Go to clients page."); VisitOffice("clients"); executionLog.Log("BulkUpdateSalesManagerForClient", "Verify page title."); VerifyTitle(); executionLog.Log("BulkUpdateSalesManagerForClient", "Click On first Check Box"); Office_ClientsHelper.ClickElement("ClickOnCheckBox"); executionLog.Log("BulkUpdateSalesManagerForClient", "Click On Bulk Update"); Office_ClientsHelper.ClickElement("ClickOnBulkUpdateClient"); executionLog.Log("BulkUpdateSalesManagerForClient", " Click on Change Sale Manager"); Office_ClientsHelper.ClickElement("BlukUpdateChangeSaleManager"); executionLog.Log("BulkUpdateSalesManagerForClient", "Select Sales MANAGER"); Office_ClientsHelper.SelectByText("SelectSaleManager", "Howard Tang"); executionLog.Log("BulkUpdateSalesManagerForClient", "Click on Update button"); Office_ClientsHelper.ClickDisplayed("//button[text()='Update']"); executionLog.Log("BulkUpdateSalesManagerForClient", "Accept alert message."); Office_ClientsHelper.AcceptAlert(); Office_ClientsHelper.WaitForText("records updated successfully", 30); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); Console.WriteLine("Counter value is " + counter); String Description = executionLog.GetAllTextFile("BulkUpdateSalesManagerForClient"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Bulk Update Sales Manager For Client"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Bulk Update Sales Manager For Client", "Bug", "Medium", "Client page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Bulk Update Sales Manager For Client"); TakeScreenshot("BulkUpdateSalesManagerForClient"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\BulkUpdateSalesManagerForClient.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("BulkUpdateSalesManagerForClient"); string id = loginHelper.getIssueID("Bulk Update Sales Manager For Client"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\BulkUpdateSalesManagerForClient.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Bulk Update Sales Manager For Client"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Bulk Update Sales Manager For Client"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("BulkUpdateSalesManagerForClient"); executionLog.WriteInExcel("Bulk Update Sales Manager For Client", Status, JIRA, "Client Management"); } }
public void clientDocumentUrlChange() { string[] username = null; string[] password = null; var oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); username = 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 office_ClientsHelper = new Office_ClientsHelper(GetWebDriver()); // Variable var FirstName = "Test" + GetRandomNumber(); var LastName = "Tester" + GetRandomNumber(); var Number = "12345678" + GetRandomNumber(); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("ClientDocumentUrlChange", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("ClientDocumentUrlChange", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("ClientDocumentUrlChange", "Goto User Agent >> Clients"); VisitOffice("clients"); executionLog.Log("ClientDocumentUrlChange", "Click On Any Client"); office_ClientsHelper.ClickElement("Client1"); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("ClientDocumentUrlChange", "Click On Add Document"); office_ClientsHelper.ClickElement("AddDoc"); var DocName = "Document Test" + GetRandomNumber(); executionLog.Log("ClientDocumentUrlChange", "Enter Document Name"); office_ClientsHelper.TypeText("DocName", DocName); var File = GetPathToFile() + "index.jpg"; executionLog.Log("ClientDocumentUrlChange", "Upload File"); office_ClientsHelper.Upload("BrowseFile", File); office_ClientsHelper.WaitForWorkAround(1000); executionLog.Log("ClientDocumentUrlChange", "Click Save"); office_ClientsHelper.ClickElement("SaveDoc"); office_ClientsHelper.WaitForWorkAround(1000); executionLog.Log("ClientDocumentUrlChange", "Click On Document "); office_ClientsHelper.PressEnter("ClientDoc1"); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("ClientDocumentUrlChange", "Change the url with the url number of another office"); VisitOffice("documents/view/41"); office_ClientsHelper.WaitForWorkAround(1000); executionLog.Log("ClientDocumentUrlChange", "Verify Validation"); office_ClientsHelper.VerifyPageText("You don't have privilege."); office_ClientsHelper.WaitForWorkAround(4000); executionLog.Log("ClientDocumentUrlChange", "Redirect to Clients Page"); VisitOffice("clients"); executionLog.Log("ClientDocumentUrlChange", "Click On Any Client"); office_ClientsHelper.ClickElement("Client1"); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("ClientDocumentUrlChange", "Click On Document "); office_ClientsHelper.PressEnter("ClientDoc1"); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("ClientDocumentUrlChange", "Click OnDelete icon"); office_ClientsHelper.ClickElement("DeleteDoc"); executionLog.Log("ClientDocumentUrlChange", "Accept alert message"); office_ClientsHelper.AcceptAlert(); executionLog.Log("ClientDocumentUrlChange", "Wait for delete message"); office_ClientsHelper.WaitForText("Document deleted successfully.", 10); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("ClientDocumentUrlChange"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Client Document Url Change"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Client Document Url Change", "Bug", "Medium", "Client page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Client Document Url Change"); TakeScreenshot("ClientDocumentUrlChange"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\ClientDocumentUrlChange.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("ClientDocumentUrlChange"); string id = loginHelper.getIssueID("Client Document Url Change"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\ClientDocumentUrlChange.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Client Document Url Change"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Client Document Url Change"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("ClientDocumentUrlChange"); executionLog.WriteInExcel("Client Document Url Change", Status, JIRA, "Client Management"); } }
public void validateName() { string[] username = null; string[] password = null; XMLParse oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); username = oXMLData.getData("settings/Credentials", "username_office"); password = oXMLData.getData("settings/Credentials", "password"); //Initializing the objects ExecutionLog executionLog = new ExecutionLog(); LoginHelper loginHelper = new LoginHelper(GetWebDriver()); var validateNames = new AdminValidateDisplayNamesHelper(GetWebDriver()); var office_ClientsHelper = new Office_ClientsHelper(GetWebDriver()); // Random Variable String JIRA = ""; String Status = "Pass"; var DBAName = "DBA@Company" + RandomNumber(1, 999); try { //executionLog.Log(" AdminValidateDisplayNames", "Wait for work around"); //validateNames.WaitForWorkAround(2000); //Logging in executionLog.Log(" AdminValidateDisplayNames", "Login"); Login(username[0], password[0]); //executionLog.Log(" AdminValidateDisplayNames", "Wait for work around"); //validateNames.WaitForWorkAround(4000); executionLog.Log(" AdminValidateDisplayNames", "Verify Dashboard"); VerifyTitle("Dashboard"); //VisitOffice("clients"); //validateNames.WaitForWorkAround(3000); //executionLog.Log(" AdminValidateDisplayNames", " Search the clients name "); //validateNames.TypeText("SearchFields", "Client's Name"); //validateNames.WaitForWorkAround(3000); //executionLog.Log(" AdminValidateDisplayNames", " Click on FirstClient "); //validateNames.ClickElement("FirstClient"); //executionLog.Log(" AdminValidateDisplayNames", "Hover on CompanyDetails "); //validateNames.MouseHover("CompanyDetails"); //executionLog.Log(" AdminValidateDisplayNames", " Click on CompanyDetails "); //validateNames.ClickElement("CompanyDetails"); //// Verifying the field exists that will be changed //executionLog.Log(" AdminValidateDisplayNames", " Verify NameCity "); //validateNames.ElementVisible("AddressLine1"); //// Going to admin office //executionLog.Log(" AdminValidateDisplayNames", " Visit office admin "); //VisitOffice("admin"); //validateNames.WaitForWorkAround(4000); // Accessing field in field dictionary VisitOffice("fields"); validateNames.WaitForWorkAround(2000); executionLog.Log("AdminValidateDisplayNames", "Select the module"); validateNames.SelectByText("Module", "Clients"); validateNames.WaitForWorkAround(2000); executionLog.Log("AdminSetValidationTime", "Select Processor as First Data North"); validateNames.SelectByText("Processor", "First Data North"); validateNames.WaitForWorkAround(2000); executionLog.Log("AdminValidateDisplayNames", "Select the module tab"); validateNames.SelectByText("Tab", "Company Details"); validateNames.WaitForWorkAround(2000); executionLog.Log("AdminValidateDisplayNames", "Select Section as Company Address"); validateNames.SelectByText("Section", "Company Details"); validateNames.WaitForWorkAround(2000); executionLog.Log(" AdminValidateDisplayNames", " Click on Search "); validateNames.ClickElement("Search"); validateNames.WaitForWorkAround(3000); executionLog.Log(" AdminValidateDisplayNames", " Click on Addressline1D "); validateNames.ClickElement("StoreName"); validateNames.WaitForWorkAround(4000); executionLog.Log(" AdminValidateDisplayNames", " Click on FieldDisplayName "); validateNames.ClickElement("ProcFieldDisplayName"); // Changing the name of the field executionLog.Log(" AdminValidateDisplayNames", " Type City Name Here"); validateNames.TypeText("ProcFieldDisplayName", "Test"); executionLog.Log(" AdminValidateDisplayNames", " Click on Save "); validateNames.ClickElement("SaveFieldManager"); executionLog.Log(" AdminValidateDisplayNames", "Wait for work around"); validateNames.WaitForWorkAround(3000); // Vist Clients site executionLog.Log("AdminValidateDisplayNames", "Redirect at Create Client"); VisitOffice("clients/create"); validateNames.WaitForWorkAround(3000); executionLog.Log("AdminValidateDisplayNames", "Select Processor"); office_ClientsHelper.SelectByText("CreateProc", "First Data North"); executionLog.Log("AdminValidateDisplayNames", "Enter Client Dba Name"); office_ClientsHelper.TypeText("ClientDBAName", DBAName); executionLog.Log("AdminValidateDisplayNames", "Select client status"); office_ClientsHelper.SelectByText("ClientStatus", "New"); executionLog.Log("AdminValidateDisplayNames", "Select Client Res[onsibility."); office_ClientsHelper.SelectByText("ClientResponsibility", "Howard Tang"); executionLog.Log("AdminValidateDisplayNames", "Click on next button"); office_ClientsHelper.ClickElement("Next"); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("AdminValidateDisplayNames", "Wait for confirmation message."); office_ClientsHelper.WaitForText("Client saved successfully. ", 10); executionLog.Log("AdminValidateDisplayNames", "Click On Contact Tab Clinet"); office_ClientsHelper.ClickElement("CompanyDetailsTab"); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("AdminValidateDisplayNames", "Verify Title of Store Name"); office_ClientsHelper.VerifyText("StoreNameLabel", "Test"); //office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("AdminValidateDisplayNames", "Redirect To clients page. "); VisitOffice("clients"); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("AdminValidateDisplayNames", "Enter Company Name"); office_ClientsHelper.TypeText("SearchClient", DBAName); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("AdminValidateDisplayNames", "Select client by check box"); office_ClientsHelper.ClickForce("ClickOn1stOpp"); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("AdminValidateDisplayNames", "Click on delete client"); office_ClientsHelper.ClickElement("DeleteClient"); executionLog.Log("AdminValidateDisplayNames", "Accept alert message."); office_ClientsHelper.AcceptAlert(); executionLog.Log("AdminValidateDisplayNames", "Wait for success message."); office_ClientsHelper.WaitForText("1 records deleted successfully", 10); executionLog.Log("AdminValidateDisplayNames", "Redirect To client recycle bin page. "); VisitOffice("clients/recyclebin"); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("AdminValidateDisplayNames", "Enter Company Name"); office_ClientsHelper.TypeText("SearchClient", DBAName); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("AdminValidateDisplayNames", "Click on delete client"); office_ClientsHelper.ClickElement("DeleteRbin"); executionLog.Log("AdminValidateDisplayNames", "Accept alert message."); office_ClientsHelper.AcceptAlert(); executionLog.Log("AdminValidateDisplayNames", "Wait for success message."); office_ClientsHelper.WaitForText("Client Permanently Deleted.", 10); // Vist field site VisitOffice("fields"); validateNames.WaitForWorkAround(2000); executionLog.Log("AdminValidateDisplayNames", "Select the module"); validateNames.SelectByText("Module", "Clients"); validateNames.WaitForWorkAround(2000); executionLog.Log("AdminSetValidationTime", "Select Processor as First Data North"); validateNames.SelectByText("Processor", "First Data North"); validateNames.WaitForWorkAround(2000); executionLog.Log("AdminValidateDisplayNames", "Select the module tab"); validateNames.SelectByText("Tab", "Company Details"); validateNames.WaitForWorkAround(2000); executionLog.Log("AdminValidateDisplayNames", "Select Section as Company Address"); validateNames.SelectByText("Section", "Company Details"); validateNames.WaitForWorkAround(2000); executionLog.Log(" AdminValidateDisplayNames", " Click on Search "); validateNames.ClickElement("Search"); validateNames.WaitForWorkAround(3000); executionLog.Log(" AdminValidateDisplayNames", " Click on Addressline1D "); validateNames.ClickElement("StoreName"); validateNames.WaitForWorkAround(4000); executionLog.Log(" AdminValidateDisplayNames", " Click on FieldDisplayName "); validateNames.ClickElement("ProcFieldDisplayName"); // Changing the name of the field executionLog.Log(" AdminValidateDisplayNames", " Type City Name Here"); validateNames.TypeText("ProcFieldDisplayName", "Store/DBA Name"); executionLog.Log(" AdminValidateDisplayNames", " Click on Save "); validateNames.ClickElement("SaveFieldManager"); executionLog.Log(" AdminValidateDisplayNames", "Wait for work around"); validateNames.WaitForWorkAround(3000); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("AdminValidateDisplayNames"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("AdminValidateDisplayNames"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("AdminValidateDisplayNames", "Bug", "Medium", "Calls page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("AdminValidateDisplayNames"); TakeScreenshot("AdminValidateDisplayNames"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\AdminValidateDisplayNames.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("AdminValidateDisplayNames"); string id = loginHelper.getIssueID("Admin Validate Display Names"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\AdminValidateDisplayNames.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Admin Validate Display Names"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Admin Validate Display Names"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("AdminValidateDisplayNames"); executionLog.WriteInExcel("Admin Validate Display Names", Status, JIRA, "Office"); } }
public void verifyLegalNameOnEmailOnCorpMerchant() { string[] username = null; string[] password = null; string[] username1 = null; var oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); username1 = oXMLData.getData("settings/Credentials", "username_office"); 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 corp_MerchantHelper = new Corp_MerchantHelper(GetWebDriver()); var office_ClientsHelper = new Office_ClientsHelper(GetWebDriver()); var officeActivities_EmailsHelper = new OfficeActivities_EmailsHelper(GetWebDriver()); var DBA = "ClientDBA" + RandomNumber(111, 999999); var email = DBA + "@yopmail.com"; // Variable random String JIRA = ""; String Status = "Pass"; try { executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "Login to office portal with valid username and password"); Login(username1[0], password[0]); executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "Verify Page title"); VerifyTitle("Dashboard"); executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "Redirect to Create Merchant page"); VisitOffice("clients/create"); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "Enter DBA name"); office_ClientsHelper.TypeText("ClientDBAName", DBA); executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "Select the client status"); office_ClientsHelper.SelectByText("Status", "New"); executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "select the responsibility"); office_ClientsHelper.SelectByText("Responsibility", "Howard Tang"); executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "Click on save btn"); office_ClientsHelper.ClickElement("Save"); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "Go to Company Details tab"); office_ClientsHelper.ClickElement("CompanyDetailsTab"); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "Enter Legal Name"); office_ClientsHelper.TypeText("ClientLegalName", DBA); //office_ClientsHelper.WaitForWorkAround(1000); executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "Click on Save button"); office_ClientsHelper.ClickElement("CDSave"); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "Click on Send Email button"); office_ClientsHelper.ClickElement("CDSendEmailBtn"); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "Enter email in To"); officeActivities_EmailsHelper.TypeText("To", email); executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "Click on Send button"); officeActivities_EmailsHelper.ClickElement("Send"); officeActivities_EmailsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "Logout from office portal"); VisitOffice("logout"); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "Login to corp portal with valid username and password"); Login(username[0], password[0]); executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "Verify Page title"); VerifyTitle("Dashboard"); executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "Redirect to All Merchant page"); VisitCorp("merchants"); corp_MerchantHelper.WaitForWorkAround(3000); executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "Redirect to Create Merchant page"); corp_MerchantHelper.TypeText("EnterClinentToSearch", DBA); corp_MerchantHelper.WaitForWorkAround(2000); executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "Open created merchant"); corp_MerchantHelper.ClickElement("OpenMerchant"); corp_MerchantHelper.WaitForWorkAround(3000); executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "Open sent email"); corp_MerchantHelper.ClickElement("ClickOnActivityAny"); corp_MerchantHelper.WaitForWorkAround(3000); executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "Verify Legal Name"); corp_MerchantHelper.VerifyText("LegalName", DBA); Console.WriteLine("Legal Name is appearing on View Email page"); executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "Logout from the corp portal"); VisitCorp("logout"); corp_MerchantHelper.WaitForWorkAround(3000); executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "Login with valid username and password"); Login(username1[0], password[0]); VisitOffice("clients"); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "Search the company Name"); office_ClientsHelper.TypeText("SearchClient", DBA); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "Click on check box"); office_ClientsHelper.ClickElement("ClickOnCheckBox"); executionLog.Log("VerifyLegalNameOnEmailOnCorpMerchant", "Delete the client"); office_ClientsHelper.ClickJS("DeleteClient"); office_ClientsHelper.AcceptAlert(); office_ClientsHelper.WaitForWorkAround(3000); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("VerifyLegalNameOnEmailOnCorpMerchant"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Verify Legal Name On Email On Corp Merchant"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Verify Legal Name On Email On Corp Merchant", "Bug", "Medium", "Corp Merchant page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Verify Legal Name On Email On Corp Merchant"); TakeScreenshot("VerifyLegalNameOnEmailOnCorpMerchant"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyLegalNameOnEmailOnCorpMerchant.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("VerifyLegalNameOnEmailOnCorpMerchant"); string id = loginHelper.getIssueID("Verify Legal Name On Email On Corp Merchant"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyLegalNameOnEmailOnCorpMerchant.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Verify Legal Name On Email On Corp Merchant"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Verify Legal Name On Email On Corp Merchant"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("VerifyLegalNameOnEmailOnCorpMerchant"); executionLog.WriteInExcel("Verify Legal Name On Email On Corp Merchant", Status, JIRA, "Corp Merchant"); } }