public void verifyImportOpportunityWithDescription() { 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 var executionLog = new ExecutionLog(); var loginHelper = new LoginHelper(GetWebDriver()); var office_OpportunitiesHelper = new Office_OpportunitiesHelper(GetWebDriver()); //Variables String JIRA = ""; String Status = "Pass"; var filepath = GetPathToFile() + "opportunitysamples - Original.csv"; try { executionLog.Log("VerifyImportOpportunityWithDescription", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("VerifyImportOpportunityWithDescription", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("VerifyImportOpportunityWithDescription", "Redirect to All opportunities page."); VisitOffice("opportunities"); executionLog.Log("VerifyImportOpportunityWithDescription", "Click on Import button"); office_OpportunitiesHelper.ClickElement("Import"); executionLog.Log("VerifyImportOpportunityWithDescription", "Select csv file to import"); office_OpportunitiesHelper.Upload("SelectFile", filepath); Console.WriteLine("Selected File"); executionLog.Log("VerifyImportOpportunityWithDescription", "Click on Import button"); office_OpportunitiesHelper.ClickElement("ImportBtn"); office_OpportunitiesHelper.WaitForWorkAround(3000); Console.WriteLine("Opportunity successfully imported"); executionLog.Log("VerifyImportOpportunityWithDescription", "Redirect to All opportunities page."); VisitOffice("opportunities"); office_OpportunitiesHelper.WaitForWorkAround(3000); Console.WriteLine("Redirected to All opportunities page"); executionLog.Log("VerifyImportOpportunityWithDescription", "Enter opportunity to be searched"); office_OpportunitiesHelper.TypeText("SearchOpportunity", "Steve"); office_OpportunitiesHelper.WaitForWorkAround(2000); executionLog.Log("VerifyImportOpportunityWithDescription", "Click on Imported opportunity"); office_OpportunitiesHelper.ClickElement("Opportunity1"); office_OpportunitiesHelper.WaitForWorkAround(3000); executionLog.Log("VerifyImportOpportunityWithDescription", "Click on Description"); office_OpportunitiesHelper.ClickForce("DescriptionHead"); office_OpportunitiesHelper.WaitForWorkAround(1000); executionLog.Log("VerifyImportOpportunityWithDescription", "Verify Description"); office_OpportunitiesHelper.VerifyText("Description", "tester1"); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("VerifyImportOpportunityWithDescription"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Verify Import Opportunity With Description"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Verify Import Opportunity With Description", "Bug", "Medium", "Partner Agents", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Verify Import Opportunity With Description"); TakeScreenshot("VerifyImportOpportunityWithDescription"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyImportOpportunityWithDescription.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("VerifyImportOpportunityWithDescription"); string id = loginHelper.getIssueID("Verify Import Opportunity With Description"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyImportOpportunityWithDescription.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Verify Import Opportunity With Description"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Verify Import Opportunity With Description"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("VerifyImportOpportunityWithDescription"); executionLog.WriteInExcel("Verify Import Opportunity With Description", Status, JIRA, "Agents Portal"); } }
public void opportunitiesValidateForExe() { 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_OpportunitiesHelper = new Office_OpportunitiesHelper(GetWebDriver()); // Variable var DocName = "Test Exe" + GetRandomNumber(); var fileUpl = GetPathToFile() + "chrome.exe"; String JIRA = ""; String Status = "Pass"; try { executionLog.Log("OpportunitiesValidateForExe", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("OpportunitiesValidateForExe", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("OpportunitiesValidateForExe", "Redirect To URL"); VisitOffice("opportunities"); office_OpportunitiesHelper.WaitForWorkAround(5000); executionLog.Log("OpportunitiesValidateForExe", "Click On Task Edit"); office_OpportunitiesHelper.ClickElement("ClickOnTaskEdit"); office_OpportunitiesHelper.WaitForWorkAround(1000); executionLog.Log("OpportunitiesValidateForExe", "Click On Add Document"); office_OpportunitiesHelper.ClickElement("ClickOnAddDocument"); office_OpportunitiesHelper.WaitForWorkAround(1000); executionLog.Log("OpportunitiesValidateForExe", "Enter Document Name"); office_OpportunitiesHelper.TypeText("EnterDocumentName", DocName); executionLog.Log("OpportunitiesValidateForExe", "Browse Doc"); office_OpportunitiesHelper.Upload("BrowseDoc", fileUpl); office_OpportunitiesHelper.WaitForWorkAround(3000); executionLog.Log("OpportunitiesValidateForExe", "Click Save Of Doc PopUp"); office_OpportunitiesHelper.ClickDisplayed("//a[text()='Save']"); office_OpportunitiesHelper.WaitForWorkAround(1000); executionLog.Log("OpportunitiesValidateForExe", "Wait for validation mesage."); office_OpportunitiesHelper.WaitForText("This field is required.", 10); office_OpportunitiesHelper.WaitForWorkAround(3000); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("OpportunitiesValidateForExe"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Opportunities Validate For Exe"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Opportunities Validate For Exe", "Bug", "Medium", "Opportunities page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Opportunities Validate For Exe"); TakeScreenshot("OpportunitiesValidateForExe"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\OpportunitiesValidateForExe.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("OpportunitiesValidateForExe"); string id = loginHelper.getIssueID("Opportunities Validate For Exe"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\OpportunitiesValidateForExe.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Opportunities Validate For Exe"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Opportunities Validate For Exe"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("OpportunitiesValidateForExe"); executionLog.WriteInExcel("Opportunities Validate For Exe", Status, JIRA, "Opportunities Management"); } }
public void verifyQuickLookLabelsForOpportunity() { 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_OpportunitiesHelper = new Office_OpportunitiesHelper(GetWebDriver()); username = oXMLData.getData("settings/Credentials", "username_office"); password = oXMLData.getData("settings/Credentials", "password"); // Variable var Oppname = "Test" + RandomNumber(99, 99999); var CDBA = "New" + RandomNumber(99, 99999); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Login with valid credential Username"); Login(username[0], password[0]); executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Create Opportunities"); VisitOffice("opportunities/create"); office_OpportunitiesHelper.WaitForWorkAround(2000); executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Click on Save"); office_OpportunitiesHelper.ClickElement("SaveOpp"); office_OpportunitiesHelper.WaitForWorkAround(2000); executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Verify text on page."); office_OpportunitiesHelper.VerifyText("RequiredFieldsOpp", "This field is required."); executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Enter Opportunity Name"); office_OpportunitiesHelper.TypeText("Name", Oppname); executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Enter Company DBA Name"); office_OpportunitiesHelper.TypeText("CompanyName", CDBA); executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Select Opp Status"); office_OpportunitiesHelper.SelectByText("State", "New"); executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Select Opp Responsibility"); office_OpportunitiesHelper.SelectByText("Responsibility", "Howard Tang"); executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Click on Save button."); office_OpportunitiesHelper.ClickElement("SaveOpp"); office_OpportunitiesHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Verify label for client type."); office_OpportunitiesHelper.VerifyText("ClientType", "Select"); executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Verify label for status."); office_OpportunitiesHelper.VerifyText("Status", "New"); executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Verify label for source."); office_OpportunitiesHelper.VerifyText("Source", "Select Source"); executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Verify label for category."); office_OpportunitiesHelper.VerifyText("Category", "Select Category"); executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Verify label for responsibility."); office_OpportunitiesHelper.VerifyText("Responsibilityl", "Howard Tang"); executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Verify label for account manager."); office_OpportunitiesHelper.VerifyText("AccountManager", "Select Account Manager"); executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Verify label for partner agent."); office_OpportunitiesHelper.VerifyText("PartnerAgentl", "Select Partner Agent"); executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Verify label for partner association."); office_OpportunitiesHelper.VerifyText("PartnerAssociationl", "Select Partner Association"); executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Verify label for sales manager."); office_OpportunitiesHelper.VerifyText("SalesManager", "Select Sales Manager"); executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Click on edit opportunity."); office_OpportunitiesHelper.ClickElement("EditLink"); office_OpportunitiesHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Select client type."); office_OpportunitiesHelper.Select("Clientt", "Processing"); //office_OpportunitiesHelper.WaitForWorkAround(1000); executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Select refferal source."); office_OpportunitiesHelper.Select("RSource", "Campaign"); //office_OpportunitiesHelper.WaitForWorkAround(1000); executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Select category."); office_OpportunitiesHelper.SelectByText("Categ", "Single"); //office_OpportunitiesHelper.WaitForWorkAround(1000); executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Select account manager."); office_OpportunitiesHelper.SelectByText("AccntManager", "Howard Tang"); //office_OpportunitiesHelper.WaitForWorkAround(1000); executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Select user group."); office_OpportunitiesHelper.SelectByText("UGroup", "Primary Group"); //office_OpportunitiesHelper.WaitForWorkAround(1000); executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Select sales manager."); office_OpportunitiesHelper.SelectByText("SaleMgr", "Howard Tang"); //office_OpportunitiesHelper.WaitForWorkAround(1000); executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Select responsibility."); office_OpportunitiesHelper.SelectByText("Responsibility", "Howard Tang"); //office_OpportunitiesHelper.WaitForWorkAround(1000); executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Select partner agent."); office_OpportunitiesHelper.SelectByText("PartnerAgent", "Mark Menu"); //office_OpportunitiesHelper.WaitForWorkAround(1000); executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Select partner association."); office_OpportunitiesHelper.SelectByText("PartAssociation", "Aslam Associate"); //office_OpportunitiesHelper.WaitForWorkAround(1000); executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Click on Save button."); office_OpportunitiesHelper.ClickElement("ClickSaveClient"); office_OpportunitiesHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Verify client type as processing."); office_OpportunitiesHelper.VerifyText("ClientType", "Processing"); executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Verify status as New"); office_OpportunitiesHelper.VerifyText("Status", "New"); executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Verify source as campaign"); office_OpportunitiesHelper.VerifyText("Source", "Campaign"); executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Verify category as Test1"); office_OpportunitiesHelper.VerifyText("Category", "Single"); executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Verify responsibility as Howard."); office_OpportunitiesHelper.VerifyText("Responsibilityl", "Howard Tang"); executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Verify account manager as Howard."); office_OpportunitiesHelper.VerifyText("AccountManager", "Howard Tang"); executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Verify partner agent as mark matthews."); office_OpportunitiesHelper.VerifyText("PartnerAgentl", "Mark Menu"); executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Verify partner association. "); office_OpportunitiesHelper.VerifyText("PartnerAssociationl", "Aslam Associate"); executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Verify sales manager as howard."); office_OpportunitiesHelper.VerifyText("SalesManager", "Howard Tang"); executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Click on delete."); office_OpportunitiesHelper.ClickElement("DeleteLink"); executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Click on Save"); office_OpportunitiesHelper.AcceptAlert(); executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Wait for success text."); office_OpportunitiesHelper.WaitForText("Opportunity deleted successfully.", 10); executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Redirect at recyclebin page."); VisitOffice("opportunities/recyclebin"); office_OpportunitiesHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Verify page title as recycled opportunities."); VerifyTitle("Recycled Opportunities"); executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Click on delete icon."); office_OpportunitiesHelper.ClickElement("DeletePermanaently"); executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Accept alert message."); office_OpportunitiesHelper.AcceptAlert(); executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Wait for success text."); office_OpportunitiesHelper.WaitForText("Opportunity permanently deleted.", 10); VisitOffice("logout"); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("VerifyQuickLookLabelsForOpportunity"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("VerifyQuickLookLabelsForOpportunity"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Opportunities", "Bug", "Medium", "Opportunity page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("VerifyQuickLookLabelsForOpportunity"); TakeScreenshot("VerifyQuickLookLabelsForOpportunity"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyQuickLookLabelsForOpportunity.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("VerifyQuickLookLabelsForOpportunity"); string id = loginHelper.getIssueID("VerifyQuickLookLabelsForOpportunity"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyQuickLookLabelsForOpportunity.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("VerifyQuickLookLabelsForOpportunity"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("VerifyQuickLookLabelsForOpportunity"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("VerifyQuickLookLabelsForOpportunity"); executionLog.WriteInExcel("VerifyQuickLookLabelsForOpportunity", Status, JIRA, "Opportunity management"); } }
public void verifyOpportunityStatusOfNoteUnderOpportunityHistory() { 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_OpportunitiesHelper = new Office_OpportunitiesHelper(GetWebDriver()); var officeActivities_NotesHelper = new OfficeActivities_NotesHelper(GetWebDriver()); username = oXMLData.getData("settings/Credentials", "username_office"); password = oXMLData.getData("settings/Credentials", "password"); // Variable var Subject = "Testnote" + RandomNumber(99, 99999); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("VerifyOpportunityStatusOfNoteUnderOpportunityHistory", "Login with valid credentials"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("VerifyOpportunityStatusOfNoteUnderOpportunityHistory", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("VerifyOpportunityStatusOfNoteUnderOpportunityHistory", "Go to All tickets page"); VisitOffice("opportunities"); office_OpportunitiesHelper.WaitForWorkAround(3000); executionLog.Log("VerifyOpportunityStatusOfNoteUnderOpportunityHistory", "Verify page title."); VerifyTitle("Opportunities"); executionLog.Log("VerifyOpportunityStatusOfNoteUnderOpportunityHistory", "Click on an opportunity"); office_OpportunitiesHelper.ClickElement("Opportunities1"); office_OpportunitiesHelper.WaitForWorkAround(3000); executionLog.Log("VerifyOpportunityStatusOfNoteUnderOpportunityHistory", "Observe Status of opportunity"); var status = office_OpportunitiesHelper.GetText("//div[@id='status']"); executionLog.Log("VerifyOpportunityStatusOfNoteUnderOpportunityHistory", "Click on Add Note button"); office_OpportunitiesHelper.ClickElement("AddNote"); office_OpportunitiesHelper.WaitForWorkAround(2000); executionLog.Log("VerifyOpportunityStatusOfNoteUnderOpportunityHistory", "Enter Subject of note"); officeActivities_NotesHelper.TypeText("Subject", Subject); executionLog.Log("VerifyOpportunityStatusOfNoteUnderOpportunityHistory", "Click on Save button"); officeActivities_NotesHelper.ClickForce("OpporSaveBtn"); office_OpportunitiesHelper.WaitForWorkAround(3000); office_OpportunitiesHelper.WaitForText("Note successfully Created.", 05); executionLog.Log("VerifyOpportunityStatusOfNoteUnderOpportunityHistory", "Select Activity Type >> Notes"); office_OpportunitiesHelper.SelectByText("ActvtyType", "Notes"); office_OpportunitiesHelper.WaitForWorkAround(2000); executionLog.Log("VerifyOpportunityStatusOfNoteUnderOpportunityHistory", "Search Note by name"); office_OpportunitiesHelper.TypeText("ActivitySubject", Subject); office_OpportunitiesHelper.WaitForWorkAround(2000); executionLog.Log("VerifyOpportunityStatusOfNoteUnderOpportunityHistory", "Verify Opportunity Status is appearing"); office_OpportunitiesHelper.VerifyText("ActvtyStatus1", status); Console.WriteLine("Opportunity Status is appearing in front of note under Opportunity History "); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("VerifyOpportunityStatusOfNoteUnderOpportunityHistory"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Verify Opportunity Status Of Note Under Opportunity History"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Verify Opportunity Status Of Note Under Opportunity History", "Bug", "Medium", "Opportunity page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Verify Opportunity Status Of Note Under Opportunity History"); TakeScreenshot("VerifyOpportunityStatusOfNoteUnderOpportunityHistory"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyOpportunityStatusOfNoteUnderOpportunityHistory.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("VerifyOpportunityStatusOfNoteUnderOpportunityHistory"); string id = loginHelper.getIssueID("Verify Opportunity Status Of Note Under Opportunity History"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyOpportunityStatusOfNoteUnderOpportunityHistory.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Verify Opportunity Status Of Note Under Opportunity History"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Verify Opportunity Status Of Note Under Opportunity History"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("VerifyOpportunityStatusOfNoteUnderOpportunityHistory"); executionLog.WriteInExcel("Verify Opportunity Status Of Note Under Opportunity History", Status, JIRA, "Office Opportunity"); } }
public void editOppStateIssue() { 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_OpportunitiesHelper = new Office_OpportunitiesHelper(GetWebDriver()); // VARIABLE var Name = "Test" + RandomNumber(1, 999); var Company = "Company" + RandomNumber(1, 9999); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("EditOppStateIssue", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("EditOppStateIssue", "Verify Page title"); VerifyTitle("Dashboard"); executionLog.Log("EditOppStateIssue", "Redirect at create opportunities page."); VisitOffice("opportunities/create"); executionLog.Log("EditOppStateIssue", "Verify Page title"); VerifyTitle("Create an Opportunity"); executionLog.Log("EditOppStateIssue", "Enter Name"); office_OpportunitiesHelper.TypeText("Name", Name); executionLog.Log("EditOppStateIssue", "Enter Company Name"); office_OpportunitiesHelper.TypeText("CompanyName", Company); executionLog.Log("EditOppStateIssue", "Select Status"); office_OpportunitiesHelper.SelectByText("State", "Closed Dead"); executionLog.Log("EditOppStateIssue", "Select Responsibility"); office_OpportunitiesHelper.SelectByText("Responsibility", "Howard Tang"); executionLog.Log("EditOppStateIssue", "Select Country"); office_OpportunitiesHelper.SelectByText("Country", "United States"); executionLog.Log("EditOppStateIssue", "Enter zipcode"); office_OpportunitiesHelper.TypeText("ZipCode", "60601"); office_OpportunitiesHelper.WaitForWorkAround(3000); executionLog.Log("EditOppStateIssue", "Click on 'Copy address' button"); office_OpportunitiesHelper.ClickForce("SameAsLocation"); executionLog.Log("EditOppStateIssue", "Click on 'Save' button"); office_OpportunitiesHelper.ClickElement("SaveOpp"); executionLog.Log("EditOppStateIssue", "Verify opp saved successfully"); office_OpportunitiesHelper.WaitForText("Opportunity saved successfully.", 10); executionLog.Log("EditOppStateIssue", "Verify Page title"); VerifyTitle("Details"); executionLog.Log("EditOppStateIssue", "Click on 'Edit' button"); office_OpportunitiesHelper.ClickElement("OppEdit"); executionLog.Log("EditOppStateIssue", "Verify Page title"); VerifyTitle("Edit an Opportunity"); executionLog.Log("EditOppStateIssue", "Redirect at create opportunities page."); VisitOffice("opportunities"); executionLog.Log("EditOppStateIssue", "Verify Page title"); VerifyTitle("Opportunities"); office_OpportunitiesHelper.WaitForWorkAround(2000); executionLog.Log("EditOppStateIssue", "Search company name"); office_OpportunitiesHelper.TypeText("SearchCompanyopp", Company); office_OpportunitiesHelper.WaitForWorkAround(2000); executionLog.Log("EditOppStateIssue", "Select All in responsibity tab"); office_OpportunitiesHelper.SelectByText("Responsibiltytab", "All"); office_OpportunitiesHelper.WaitForWorkAround(3000); executionLog.Log("EditOppStateIssue", "Select first opportunity"); office_OpportunitiesHelper.ClickElement("ClickOn1stOpp"); executionLog.Log("EditOppStateIssue", "Click on delete button."); office_OpportunitiesHelper.ClickElement("DeleteOpp"); executionLog.Log("EditOppStateIssue", "Accept alert message"); office_OpportunitiesHelper.AcceptAlert(); executionLog.Log("EditOppStateIssue", "Wait for deleted success message."); office_OpportunitiesHelper.WaitForText("1 records deleted successfully", 10); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("EditOppStateIssue"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Edit Opp State Issue"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Edit Opp State Issue", "Bug", "Medium", "Opportunity page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Edit Opp State Issue"); TakeScreenshot("EditOppStateIssue"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\EditOppStateIssue.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("EditOppStateIssue"); string id = loginHelper.getIssueID("Edit Opp State Issue"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\EditOppStateIssue.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Edit Opp State Issue"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Edit Opp State Issue"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("EditOppStateIssue"); executionLog.WriteInExcel("Edit Opp State Issue", Status, JIRA, "Opportunities Management"); } }
public void verifyOpportunitiesCreatedModifiedByCredits() { 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_OpportunitiesHelper = new Office_OpportunitiesHelper(GetWebDriver()); username = oXMLData.getData("settings/Credentials", "username_office"); password = oXMLData.getData("settings/Credentials", "password"); // Variable var Oppname = "Test" + RandomNumber(99, 99999); var CDBA = "New" + RandomNumber(99, 99999); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Login with valid credential Username"); Login(username[0], password[0]); executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Create Opportunities"); VisitOffice("opportunities/create"); executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Click on Save"); office_OpportunitiesHelper.ClickElement("SaveOpp"); office_OpportunitiesHelper.WaitForWorkAround(2000); executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Verify text on page."); office_OpportunitiesHelper.VerifyText("RequiredFieldsOpp", "This field is required."); executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Enter Opportunity Name"); office_OpportunitiesHelper.TypeText("Name", Oppname); executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Enter Company DBA Name"); office_OpportunitiesHelper.TypeText("CompanyName", CDBA); executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Select Opp Status"); office_OpportunitiesHelper.SelectByText("State", "New"); executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Select Opp Responsibility"); office_OpportunitiesHelper.SelectByText("Responsibility", "Howard Tang"); executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Click on Save"); office_OpportunitiesHelper.ClickElement("SaveOpp"); office_OpportunitiesHelper.WaitForWorkAround(3000); var loc = "//h3[text()='Existing Opportunities']"; if (office_OpportunitiesHelper.IsElementPresent(loc)) { executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Click Dublicate Button"); office_OpportunitiesHelper.ClickOnDisplayed("ClickOnDubBtn"); executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Wait for success message"); office_OpportunitiesHelper.WaitForText("Opportunity saved successfully.", 10); executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Verify opportunity created by"); office_OpportunitiesHelper.VerifyText("CreatedBy", "Howard Tang"); executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Verify opportunity modified by"); office_OpportunitiesHelper.VerifyText("ModifiedBy", "Howard Tang"); executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Click on edit button."); office_OpportunitiesHelper.ClickElement("EditLink"); executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Click on save button."); office_OpportunitiesHelper.ClickElement("SaveOpp"); executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Verify opportunity created by"); office_OpportunitiesHelper.VerifyText("CreatedBy", "Howard Tang"); executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Verify opportunity modified by"); office_OpportunitiesHelper.VerifyText("ModifiedBy", "Howard Tang"); executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Redirect at Opportunities"); VisitOffice("VerifyOpportunitiesCreatedModifiedByCredits"); executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Click on 1st Opportunities"); office_OpportunitiesHelper.ClickElement("ClickOn1stOpp"); executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Click On Merge Records"); office_OpportunitiesHelper.ClickElement("DeleteLink"); office_OpportunitiesHelper.AcceptAlert(); executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Wait for confirmation"); office_OpportunitiesHelper.WaitForText("1 records deleted successfully", 10); executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Redirect at recyclebin Page."); VisitOffice("opportunities/recyclebin"); executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Verify page title."); VerifyTitle("Recycled Opportunities"); executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Click on delete icon."); office_OpportunitiesHelper.ClickElement("DeletePermanaently"); office_OpportunitiesHelper.AcceptAlert(); executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Wait For Confirmation"); office_OpportunitiesHelper.WaitForText("Opportunity permanently deleted.", 10); } else { executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Wait for success message"); office_OpportunitiesHelper.WaitForText("Opportunity saved successfully.", 10); executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Verify opportunity created by"); office_OpportunitiesHelper.VerifyText("CreatedBy", "Howard Tang"); executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Verify opportunity modified by"); office_OpportunitiesHelper.VerifyText("ModifiedBy", "Howard Tang"); executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Click on edit button."); office_OpportunitiesHelper.ClickElement("EditLink"); executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Click on save button."); office_OpportunitiesHelper.ClickElement("SaveOpp"); executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Verify opportunity created by"); office_OpportunitiesHelper.VerifyText("CreatedBy", "Howard Tang"); executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Verify opportunity modified by"); office_OpportunitiesHelper.VerifyText("ModifiedBy", "Howard Tang"); executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Redirect at Opportunities"); VisitOffice("opportunities"); executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Click on 1st Opportunities"); office_OpportunitiesHelper.ClickElement("ClickOn1stOpp"); executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Click On Merge Records"); office_OpportunitiesHelper.ClickElement("DeleteLink"); office_OpportunitiesHelper.AcceptAlert(); executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Wait for confirmation"); office_OpportunitiesHelper.WaitForText("1 records deleted successfully", 10); executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Redirect at recyclebin Page."); VisitOffice("opportunities/recyclebin"); executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Verify page title."); VerifyTitle("Recycled Opportunities"); executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Click on delete icon."); office_OpportunitiesHelper.ClickElement("DeletePermanaently"); office_OpportunitiesHelper.AcceptAlert(); executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Wait For Confirmation"); office_OpportunitiesHelper.WaitForText("Opportunity permanently deleted.", 10); } } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("VerifyOpportunitiesCreatedModifiedByCredits"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("VerifyOpportunitiesCreatedModifiedByCredits"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("VerifyOpportunitiesCreatedModifiedByCredits", "Bug", "Medium", "Opportunity page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("VerifyOpportunitiesCreatedModifiedByCredits"); TakeScreenshot("VerifyOpportunitiesCreatedModifiedByCredits"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\Opportunities.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("VerifyOpportunitiesCreatedModifiedByCredits"); string id = loginHelper.getIssueID("VerifyOpportunitiesCreatedModifiedByCredits"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\Opportunities.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("VerifyOpportunitiesCreatedModifiedByCredits"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("VerifyOpportunitiesCreatedModifiedByCredits"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("VerifyOpportunitiesCreatedModifiedByCredits"); executionLog.WriteInExcel("VerifyOpportunitiesCreatedModifiedByCredits", Status, JIRA, "Opportunity management"); } }
public void verifyOpportunityToClientConversionDataBleed() { 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_OpportunitiesHelper = new Office_OpportunitiesHelper(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 CDBA = "New" + RandomNumber(99, 99999); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("VerifyOpportunityToClientConversionDataBleed", "Login with valid credentials"); Login(username[0], password[0]); executionLog.Log("VerifyOpportunityToClientConversionDataBleed", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("VerifyOpportunityToClientConversionDataBleed", "Create Opportunities"); VisitOffice("opportunities/create"); office_OpportunitiesHelper.WaitForWorkAround(2000); executionLog.Log("VerifyOpportunityToClientConversionDataBleed", "Enter Opportunity Name"); office_OpportunitiesHelper.TypeText("Name", Oppname); executionLog.Log("VerifyOpportunityToClientConversionDataBleed", "Enter Company DBA Name"); office_OpportunitiesHelper.TypeText("CompanyName", CDBA); executionLog.Log("VerifyOpportunityToClientConversionDataBleed", "Select Opp Status"); office_OpportunitiesHelper.SelectByText("State", "New"); executionLog.Log("VerifyOpportunityToClientConversionDataBleed", "Select Opp Responsibility"); office_OpportunitiesHelper.SelectByText("Responsibility", "Howard Tang"); executionLog.Log("VerifyOpportunityToClientConversionDataBleed", "Click on Save"); office_OpportunitiesHelper.clickJS("SaveOpp"); office_OpportunitiesHelper.WaitForWorkAround(3000); executionLog.Log("VerifyOpportunityToClientConversionDataBleed", "Click on convert button"); office_OpportunitiesHelper.ClickElement("Convert"); office_OpportunitiesHelper.WaitForWorkAround(500); executionLog.Log("VerifyOpportunityToClientConversionDataBleed", "Click on client radio button"); office_OpportunitiesHelper.ClickElement("ClientRadio"); executionLog.Log("VerifyOpportunityToClientConversionDataBleed", "Click on No Recycle Bin"); office_OpportunitiesHelper.ClickElement("RecycleNo"); executionLog.Log("VerifyOpportunityToClientConversionDataBleed", "Click on save button."); office_OpportunitiesHelper.clickJS("SaveConfirm"); office_OpportunitiesHelper.WaitForWorkAround(3000); executionLog.Log("VerifyOpportunityToClientConversionDataBleed", "Click on Company Details tab"); office_ClientsHelper.ClickElement("CompanyDetailsTab"); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyOpportunityToClientConversionDataBleed", "Verify Legal Name is blank"); Assert.AreEqual(office_ClientsHelper.getInputText("//input[@id='ClientDetailCompanyLegalName']"), ""); executionLog.Log("VerifyOpportunityToClientConversionDataBleed", "Click on Merchant Numbers tab"); office_ClientsHelper.ClickElement("MerchantNumber"); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyOpportunityToClientConversionDataBleed", "Verify Merchant ID is blank"); Assert.AreEqual(office_ClientsHelper.getInputText("//input[@id='ClientDetailMerchID']"), ""); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("VerifyOpportunityToClientConversionDataBleed"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Verify Opportunity To Client Conversion Data Bleed"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Verify Opportunity To Client Conversion Data Bleed", "Bug", "Medium", "Terminals and Equipment tab", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Verify Opportunity To Client Conversion Data Bleed"); TakeScreenshot("VerifyOpportunityToClientConversionDataBleed"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyOpportunityToClientConversionDataBleed.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("VerifyOpportunityToClientConversionDataBleed"); string id = loginHelper.getIssueID("Verify Opportunity To Client Conversion Data Bleed"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyOpportunityToClientConversionDataBleed.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Verify Opportunity To Client Conversion Data Bleed"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Verify Opportunity To Client Conversion Data Bleed"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("VerifyOpportunityToClientConversionDataBleed"); executionLog.WriteInExcel("Verify Opportunity To Client Conversion Data Bleed", Status, JIRA, "Office Opportunity"); } }
public void partnerAgentCodeInQuickLook() { 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_OpportunitiesHelper = new Office_OpportunitiesHelper(GetWebDriver()); // Variable String JIRA = ""; String Status = "Pass"; try { executionLog.Log("PartnerAgentCodeInQuickLook", "Login with valid credential Username"); Login(username[0], password[0]); executionLog.Log("PartnerAgentCodeInQuickLook", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("PartnerAgentCodeInQuickLook", "Goto Opportinuties"); VisitOffice("opportunities"); executionLog.Log("PartnerAgentCodeInQuickLook", "Open Opportunity"); office_OpportunitiesHelper.ClickElement("Opportunities1"); office_OpportunitiesHelper.WaitForWorkAround(5000); executionLog.Log("PartnerAgentCodeInQuickLook", "Edit Opportunity"); office_OpportunitiesHelper.clickJS("OppEdit"); office_OpportunitiesHelper.WaitForWorkAround(3000); executionLog.Log("PartnerAgentCodeInQuickLook", "Enter Partner Agent Code."); office_OpportunitiesHelper.TypeText("PartnerAgentCode_Field", "233"); executionLog.Log("PartnerAgentCodeInQuickLook", "Select the status"); office_OpportunitiesHelper.SelectByText("State", "New"); executionLog.Log("PartnerAgentCodeInQuickLook", "Click On Save Button"); office_OpportunitiesHelper.clickJS("ClickSaveClient"); office_OpportunitiesHelper.WaitForWorkAround(9000); executionLog.Log("PartnerAgentCodeInQuickLook", "Verify added code in Quick Look."); office_OpportunitiesHelper.VerifyPageText("223"); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("AmexRateCorp"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Amex Rate Corp"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Amex Rate Corp", "Bug", "Medium", "Amex page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Amex Rate Corp"); TakeScreenshot("AmexRateCorp"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\AmexRateCorp.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("AmexRateCorp"); string id = loginHelper.getIssueID("Amex Rate Corp"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\AmexRateCorp.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Amex Rate Corp"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Amex Rate Corp"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("AmexRateCorp"); executionLog.WriteInExcel("Amex Rate Corp", Status, JIRA, "Corp Master Data"); } }
public void opportunititySubjectFiledValidateBlank() { 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_OpportunitiesHelper = new Office_OpportunitiesHelper(GetWebDriver()); // VARIABLE var name = "TestEmployee" + GetRandomNumber(); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("OpportunititySubjectFiledValidateBlank", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("OpportunititySubjectFiledValidateBlank", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("OpportunititySubjectFiledValidateBlank", "Redirect at opportunities page."); VisitOffice("opportunities"); office_OpportunitiesHelper.WaitForWorkAround(2000); executionLog.Log("OpportunititySubjectFiledValidateBlank", "Click TO View Opp"); office_OpportunitiesHelper.ClickElement("Opportunities1"); executionLog.Log("OpportunititySubjectFiledValidateBlank", "Click on add note"); office_OpportunitiesHelper.ClickElement("AddNotes"); office_OpportunitiesHelper.WaitForWorkAround(2000); executionLog.Log("OpportunititySubjectFiledValidateBlank", "Leave note subject blank."); office_OpportunitiesHelper.TypeText("EnterNoteName", " "); executionLog.Log("OpportunititySubjectFiledValidateBlank", "Click Save Note Button"); office_OpportunitiesHelper.ClickElement("SaveNote"); office_OpportunitiesHelper.WaitForWorkAround(3000); executionLog.Log("OpportunititySubjectFiledValidateBlank", "Verify validation message."); office_OpportunitiesHelper.VerifyText("VerifyTextNoteValidation", "This field is required."); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("OpportunititySubjectFiledValidateBlank"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Opportunitity Subject Filed Validate Blank"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Opportunitity Subject Filed Validate Blank", "Bug", "Medium", "Add Note page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Opportunitity Subject Filed Validate Blank"); TakeScreenshot("OpportunititySubjectFiledValidateBlank"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\OpportunititySubjectFiledValidateBlank.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("OpportunititySubjectFiledValidateBlank"); string id = loginHelper.getIssueID("Opportunitity Subject Filed Validate Blank"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\OpportunititySubjectFiledValidateBlank.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Opportunitity Subject Filed Validate Blank"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Opportunitity Subject Filed Validate Blank"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("OpportunititySubjectFiledValidateBlank"); executionLog.WriteInExcel("Opportunitity Subject Filed Validate Blank", Status, JIRA, "Opportunities Management"); } }
public void editOpportunityGroupWithExistingName() { 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 var executionLog = new ExecutionLog(); var loginHelper = new LoginHelper(GetWebDriver()); var office_OpportunitiesHelper = new Office_OpportunitiesHelper(GetWebDriver()); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("EditOpportunityGroupWithExistingName", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("EditOpportunityGroupWithExistingName", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("EditOpportunityGroupWithExistingName", "Redirect at manage group page."); VisitOffice("opportunities/manage_groups"); office_OpportunitiesHelper.WaitForWorkAround(3000); executionLog.Log("EditOpportunityGroupWithExistingName", "Click on edit opportunity group."); office_OpportunitiesHelper.ClickElement("EditGroup"); office_OpportunitiesHelper.WaitForWorkAround(1000); executionLog.Log("EditOpportunityGroupWithExistingName", "Enter group name."); office_OpportunitiesHelper.TypeText("GroupName", "Required"); executionLog.Log("EditOpportunityGroupWithExistingName", "Click on save group."); office_OpportunitiesHelper.ClickElement("SaveGroup"); office_OpportunitiesHelper.WaitForWorkAround(2000); executionLog.Log("EditOpportunityGroupWithExistingName", "Verify validation for already existing."); office_OpportunitiesHelper.VerifyText("GroupError", "Name already exists"); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("EditOpportunityGroupWithExistingName"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Edit Opportunity Group With Existing Name"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Edit Opportunity Group With Existing Name", "Bug", "Medium", "Opportunity page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Edit Opportunity Group With Existing Name"); TakeScreenshot("EditOpportunityGroupWithExistingName"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\EditOpportunityGroupWithExistingName.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("EditOpportunityGroupWithExistingName"); string id = loginHelper.getIssueID("Edit Opportunity Group With Existing Name"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\EditOpportunityGroupWithExistingName.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Edit Opportunity Group With Existing Name"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Edit Opportunity Group With Existing Name"); executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("EditOpportunityGroupWithExistingName"); executionLog.WriteInExcel("Edit Opportunity Group With Existing Name", Status, JIRA, "Opportunities Management"); } }
public void verifyingOpportunityeAddresslabel() { 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_OpportunitiesHelper = new Office_OpportunitiesHelper(GetWebDriver()); // Variable var Name = "Opportunity" + GetRandomNumber(); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("VerifyingOpportunityeAddresslabel", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("VerifyingOpportunityeAddresslabel", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("VerifyingOpportunityeAddresslabel", "Redirect To URL"); VisitOffice("opportunities/create"); executionLog.Log("VerifyingOpportunityeAddresslabel", "Enter Opportunity Name"); office_OpportunitiesHelper.TypeText("Name", Name); executionLog.Log("VerifyingOpportunityeAddresslabel", "Enter Company Name"); office_OpportunitiesHelper.TypeText("CompanyName", Name); executionLog.Log("VerifyingOpportunityeAddresslabel", "Select Opportunity Status"); office_OpportunitiesHelper.Select("State", "New"); executionLog.Log("VerifyingOpportunityeAddresslabel", "Select Opportunity responsibility"); office_OpportunitiesHelper.SelectByText("Responsibility", "Howard Tang"); executionLog.Log("VerifyingOpportunityeAddresslabel", "Select eAddress Type"); office_OpportunitiesHelper.Select("EaddressType", "E-Mail"); office_OpportunitiesHelper.WaitForWorkAround(3000); executionLog.Log("VerifyingOpportunityeAddresslabel", "Verify eAddress Label"); office_OpportunitiesHelper.VerifyText("EaddressLabel", "Home"); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("VerifyingOpportunityeAddresslabel"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Verifying Opportunity eAddress label"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Verifying Opportunity eAddress label", "Bug", "Medium", "Opportunities page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Verifying Opportunity eAddress label"); TakeScreenshot("VerifyingOpportunityeAddresslabel"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyingOpportunityeAddresslabel.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("VerifyingOpportunityeAddresslabel"); string id = loginHelper.getIssueID("Verifying Opportunity eAddress label"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyingOpportunityeAddresslabel.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Verifying Opportunity eAddress label"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Verifying Opportunity eAddress label"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("VerifyingOpportunityeAddresslabel"); executionLog.WriteInExcel("Verifying Opportunity eAddress label", Status, JIRA, "Opportunities Management"); } }
public void activitiesDocumentManagement() { 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 var executionLog = new ExecutionLog(); var loginHelper = new LoginHelper(GetWebDriver()); var officeActivities_DocumentsHelper = new OfficeActivities_DocumentHelper(GetWebDriver()); var office_ClientsHelper = new Office_ClientsHelper(GetWebDriver()); var office_LeadsHelper = new Office_LeadsHelper(GetWebDriver()); var office_OpportunitiesHelper = new Office_OpportunitiesHelper(GetWebDriver()); var ticket_CreateATicketHelper = new OfficeTickets_CreateTicketsHelper(GetWebDriver()); // Variable var name = "Doc" + RandomNumber(1, 9999); var email = "Test" + GetRandomNumber() + "@gmail.com"; String ValidFile = GetPathToFile() + "leadslist.csv"; String InvalidFile = GetPathToFile() + "chrome.exe"; String JIRA = ""; String Status = "Pass"; try { executionLog.Log("ActivitiesDocumentManagement", " Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("ActivitiesDocumentManagement", "Verify Page title"); VerifyTitle("Dashboard"); executionLog.Log("ActivitiesDocumentManagement", "Click On Admin"); VisitOffice("admin"); executionLog.Log("ActivitiesDocumentManagement", "Redirect to create document page"); VisitOffice("documents/create"); officeActivities_DocumentsHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesDocumentManagement", "verify title"); VerifyTitle("Create a New Document"); executionLog.Log("ActivitiesDocumentManagement", "Click on Save button"); officeActivities_DocumentsHelper.ClickElement("Save"); executionLog.Log("ActivitiesDocumentManagement", "Verify validation message for name."); officeActivities_DocumentsHelper.VerifyText("NameError", "This field is required."); executionLog.Log("ActivitiesDocumentManagement", "Verify validation message for attachment."); officeActivities_DocumentsHelper.VerifyText("AttachmentError", "This field is required."); executionLog.Log("ActivitiesDocumentManagement", "Enter Document name"); officeActivities_DocumentsHelper.TypeText("Name", name); executionLog.Log("ActivitiesDocumentManagement", "Click on document version"); officeActivities_DocumentsHelper.ClickElement("DocumentVersion"); executionLog.Log("ActivitiesDocumentManagement", "Upload an invalid File "); officeActivities_DocumentsHelper.Upload("BrowseAttachment", InvalidFile); executionLog.Log("ActivitiesDocumentManagement", "Verify alert message for invalid file."); officeActivities_DocumentsHelper.VerifyAlertText("please select a valid file!"); officeActivities_DocumentsHelper.AcceptAlert(); executionLog.Log("ActivitiesDocumentManagement", "Upload a valid File."); officeActivities_DocumentsHelper.Upload("BrowseAttachment", ValidFile); executionLog.Log("ActivitiesDocumentManagement", "Select Assign owner"); officeActivities_DocumentsHelper.SelectByText("AssignOwner", "Howard Tang"); executionLog.Log("ActivitiesDocumentManagement", "Select status"); officeActivities_DocumentsHelper.SelectByText("Status", "Active"); executionLog.Log("ActivitiesDocumentManagement", "Click on Save button"); officeActivities_DocumentsHelper.ClickElement("Save"); executionLog.Log("ActivitiesDocumentManagement", "Wait for success message."); officeActivities_DocumentsHelper.WaitForText("Document saved successfully.", 10); officeActivities_DocumentsHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesDocumentManagement", "Search document by name."); officeActivities_DocumentsHelper.TypeText("SearchDocumet", name); officeActivities_DocumentsHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesDocumentManagement", "Select All in owner field"); officeActivities_DocumentsHelper.SelectByText("OwnerField", "All"); officeActivities_DocumentsHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesDocumentManagement", "Click on edit icon."); officeActivities_DocumentsHelper.ClickElement("EditDoc"); executionLog.Log("ActivitiesDocumentManagement", "Select document parent/related to."); officeActivities_DocumentsHelper.SelectByText("ReletedTo", "Client"); //officeActivities_DocumentsHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesDocumentManagement", "Click on find list icon."); officeActivities_DocumentsHelper.ClickElement("Assign"); //officeActivities_DocumentsHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesDocumentManagement", "Click on any client."); officeActivities_DocumentsHelper.ClickElement("AssignUser"); //officeActivities_DocumentsHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesDocumentManagement", "Click on Save button"); officeActivities_DocumentsHelper.ClickElement("Save"); executionLog.Log("ActivitiesDocumentManagement", "Wait for success message."); officeActivities_DocumentsHelper.WaitForText("Document updated successfully.", 10); executionLog.Log("ActivitiesDocumentManagement", "Redirect at clients page."); VisitOffice("clients"); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesDocumentManagement", "Click on any client."); office_ClientsHelper.ClickElement("Client1"); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesDocumentManagement", "Select actitivity type as documents."); office_ClientsHelper.SelectByText("SelectActivityType", "Documents"); executionLog.Log("ActivitiesDocumentManagement", "Enter document name to be search."); office_ClientsHelper.TypeText("ActivitySubject", name); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesDocumentManagement", "Select All in created by field"); office_ClientsHelper.SelectByText("CreatedByField", "All"); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesDocumentManagement", "Verify created document present on client page."); office_ClientsHelper.IsElementPresent("OpenFirstActivity"); executionLog.Log("ActivitiesDocumentManagement", "Redirect to document page"); VisitOffice("documents"); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesDocumentManagement", "Search document by name."); officeActivities_DocumentsHelper.TypeText("SearchDocumet", name); officeActivities_DocumentsHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesDocumentManagement", "Select All in owner field"); officeActivities_DocumentsHelper.SelectByText("OwnerField", "All"); officeActivities_DocumentsHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesDocumentManagement", "Click on edit icon."); officeActivities_DocumentsHelper.ClickElement("EditDoc"); executionLog.Log("ActivitiesDocumentManagement", "Select document related to."); officeActivities_DocumentsHelper.Select("ReletedTo", "14"); //officeActivities_DocumentsHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesDocumentManagement", "Click on find list icon."); officeActivities_DocumentsHelper.ClickElement("Assign"); //officeActivities_DocumentsHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesDocumentManagement", "Click on any lead."); officeActivities_DocumentsHelper.ClickElement("AssignUser"); //officeActivities_DocumentsHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesDocumentManagement", "Click on Save button"); officeActivities_DocumentsHelper.ClickElement("Save"); executionLog.Log("ActivitiesDocumentManagement", "Wait for success message."); officeActivities_DocumentsHelper.WaitForText("Document updated successfully.", 10); executionLog.Log("ActivitiesDocumentManagement", "Redirect at leads page."); VisitOffice("leads"); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesDocumentManagement", "Click On any lead."); office_LeadsHelper.ClickElement("ClickAnyLead"); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesDocumentManagement", "Select actitivity type as documents."); office_LeadsHelper.SelectByText("SelectActivityType", "Documents"); executionLog.Log("ActivitiesDocumentManagement", "Enter document name to be search."); office_LeadsHelper.TypeText("ActivitySubject", name); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesDocumentManagement", "Verify created document present on leads page."); office_LeadsHelper.IsElementPresent("ClickNotes1"); executionLog.Log("ActivitiesDocumentManagement", "Redirect to document page"); VisitOffice("documents"); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesDocumentManagement", "Search document by name."); officeActivities_DocumentsHelper.TypeText("SearchDocumet", name); officeActivities_DocumentsHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesDocumentManagement", "Select All in owner field"); officeActivities_DocumentsHelper.SelectByText("OwnerField", "All"); officeActivities_DocumentsHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesDocumentManagement", "Click on edit icon."); officeActivities_DocumentsHelper.ClickElement("EditDoc"); executionLog.Log("ActivitiesDocumentManagement", "Select document parent/related to."); officeActivities_DocumentsHelper.Select("ReletedTo", "15"); //officeActivities_DocumentsHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesDocumentManagement", "Click on find list icon."); officeActivities_DocumentsHelper.ClickElement("Assign"); //officeActivities_DocumentsHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesDocumentManagement", "Click on any opportunity."); officeActivities_DocumentsHelper.ClickElement("AssignUser"); //officeActivities_DocumentsHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesDocumentManagement", "Click on Save button"); officeActivities_DocumentsHelper.ClickElement("Save"); executionLog.Log("ActivitiesDocumentManagement", "Wait for success message."); officeActivities_DocumentsHelper.WaitForText("Document updated successfully.", 10); executionLog.Log("ActivitiesDocumentManagement", "Redirect at opportunities page."); VisitOffice("opportunities"); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesDocumentManagement", "Click On any opportunity."); office_OpportunitiesHelper.ClickElement("Opportunities1"); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesDocumentManagement", "Select actitivity type as documents"); office_LeadsHelper.Select("SelectActivityType", "Documents"); executionLog.Log("ActivitiesDocumentManagement", "Enter documents name to be search."); office_OpportunitiesHelper.TypeText("ActivitySubject", name); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesDocumentManagement", "Verify created document present on opportunity page"); office_OpportunitiesHelper.IsElementPresent("OpenOpportunity"); executionLog.Log("ActivitiesDocumentManagement", "Redirect to document page"); VisitOffice("documents"); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesDocumentManagement", "Search document by name."); officeActivities_DocumentsHelper.TypeText("SearchDocumet", name); officeActivities_DocumentsHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesDocumentManagement", "Select All in owner field"); officeActivities_DocumentsHelper.SelectByText("OwnerField", "All"); officeActivities_DocumentsHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesDocumentManagement", "Click on edit icon."); officeActivities_DocumentsHelper.ClickElement("EditDoc"); executionLog.Log("ActivitiesDocumentManagement", "Select document related to."); officeActivities_DocumentsHelper.Select("ReletedTo", "36"); //officeActivities_DocumentsHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesDocumentManagement", "Click on find list icon."); officeActivities_DocumentsHelper.ClickElement("Assign"); //officeActivities_DocumentsHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesDocumentManagement", "Click on any ticket."); officeActivities_DocumentsHelper.ClickElement("AssignUser"); //officeActivities_DocumentsHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesDocumentManagement", "Click on Save button"); officeActivities_DocumentsHelper.ClickElement("Save"); executionLog.Log("ActivitiesDocumentManagement", "Wait for success message."); officeActivities_DocumentsHelper.WaitForText("Document updated successfully.", 10); executionLog.Log("ActivitiesDocumentManagement", "Redirect at tickets page."); VisitOffice("tickets"); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesDocumentManagement", "Click On any ticket."); ticket_CreateATicketHelper.ClickElement("Ticket1"); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesDocumentManagement", "Select actitivity type as documents"); office_LeadsHelper.Select("SelectActivityType", "Documents"); executionLog.Log("ActivitiesDocumentManagement", "Enter document name to be search."); office_OpportunitiesHelper.TypeText("ActivitySubject", name); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesDocumentManagement", "Verify created document present on ticket page."); ticket_CreateATicketHelper.IsElementPresent("OpenTicket"); executionLog.Log("ActivitiesDocumentManagement", "Redirect to document page"); VisitOffice("documents"); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesDocumentManagement", "Search document by name."); officeActivities_DocumentsHelper.TypeText("SearchDocumet", name); officeActivities_DocumentsHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesDocumentManagement", "Select All in owner field"); officeActivities_DocumentsHelper.SelectByText("OwnerField", "All"); officeActivities_DocumentsHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesDocumentManagement", "Click on Checkbox"); officeActivities_DocumentsHelper.ClickElement("CheckDocToDel"); //officeActivities_DocumentsHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesDocumentManagement", "Click on Delete button"); officeActivities_DocumentsHelper.ClickElement("DeleteDoc"); //officeActivities_DocumentsHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesDocumentManagement", "Acccept alert to delete doc."); officeActivities_DocumentsHelper.AcceptAlert(); //officeActivities_DocumentsHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesDocumentManagement", "Wait for success message."); officeActivities_DocumentsHelper.WaitForText("Document deleted successfully.", 10); executionLog.Log("ActivitiesDocumentManagement", "Redirect at recyclebin page."); VisitOffice("documents/recyclebin"); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesDocumentManagement", "Verify page title."); VerifyTitle("Recycled Document"); executionLog.Log("ActivitiesDocumentManagement", "Click on delete icon."); officeActivities_DocumentsHelper.ClickElement("DeleteRecycle"); officeActivities_DocumentsHelper.AcceptAlert(); //officeActivities_DocumentsHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesDocumentManagement", "Wait for success message.."); officeActivities_DocumentsHelper.WaitForText("Document Permanently Deleted.", 10); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("ActivitiesDocumentManagement"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Activities Document Management"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Activities Document Management", "Bug", "Medium", "Document page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Activities Document Management"); TakeScreenshot("ActivitiesDocumentManagement"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\ActivitiesDocumentManagement.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("ActivitiesDocumentManagement"); string id = loginHelper.getIssueID("Activities Document Management"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\ActivitiesDocumentManagement.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Activities Document Management"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Activities Document Management"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("ActivitiesDocumentManagement"); executionLog.WriteInExcel("Activities Document Management", Status, JIRA, "Office Activities"); } }
public void opportunityGroupWithBlankName() { 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 var executionLog = new ExecutionLog(); var loginHelper = new LoginHelper(GetWebDriver()); var office_OpportunitiesHelper = new Office_OpportunitiesHelper(GetWebDriver()); String JIRA = ""; String Status = "Pass"; //try //{ executionLog.Log("OpportunityGroupWithBlankName", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("OpportunityGroupWithBlankName", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("OpportunityGroupWithBlankName", "Redirect at opportunities group page."); VisitOffice("opportunities/manage_groups"); executionLog.Log("OpportunityGroupWithBlankName", "Click on Edit group."); office_OpportunitiesHelper.ClickElement("EditGroup"); executionLog.Log("OpportunityGroupWithBlankName", "Remove the group name."); office_OpportunitiesHelper.TypeText("GroupName", ""); executionLog.Log("OpportunityGroupWithBlankName", "Click on Save button."); office_OpportunitiesHelper.ClickElement("SaveGroup"); executionLog.Log("OpportunityGroupWithBlankName", "Wait for locator to be present."); office_OpportunitiesHelper.WaitForElementPresent("GroupError", 10); executionLog.Log("OpportunityGroupWithBlankName", "Verify validation is displayed."); office_OpportunitiesHelper.VerifyText("GroupError", "Name: Field is required"); //} //catch (Exception e) //{ // executionLog.Log("Error", e.StackTrace); // Status = "Fail"; // String counter = executionLog.readLastLine("counter"); // String Description = executionLog.GetAllTextFile("OpportunityGroupWithBlankName"); // String Error = executionLog.GetAllTextFile("Error"); // if (counter == "") // { // counter = "0"; // } // bool result = loginHelper.CheckExstingIssue("Opportunity Group With Blank Name"); // if (!result) // { // if (Int16.Parse(counter) < 9) // { // executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); // loginHelper.CreateIssue("Opportunity Group With Blank Name", "Bug", "Medium", "Opportunities page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); // string id = loginHelper.getIssueID("Opportunity Group With Blank Name"); // TakeScreenshot("OpportunityGroupWithBlankName"); // string directoryName = loginHelper.GetnewDirectoryName(GetPath()); // var location = directoryName + "\\OpportunityGroupWithBlankName.png"; // loginHelper.AddAttachment(location, id); // } // } // else // { // if (Int16.Parse(counter) < 9) // { // executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); // TakeScreenshot("OpportunityGroupWithBlankName"); // string id = loginHelper.getIssueID("Opportunity Group With Blank Name"); // string directoryName = loginHelper.GetnewDirectoryName(GetPath()); // var location = directoryName + "\\OpportunityGroupWithBlankName.png"; // loginHelper.AddAttachment(location, id); // loginHelper.AddComment(loginHelper.getIssueID("Opportunity Group With Blank Name"), "This issue is still occurring"); // } // } // JIRA = loginHelper.getIssueID("Opportunity Group With Blank Name"); //// executionLog.DeleteFile("Error"); // throw; //} //finally //{ // executionLog.DeleteFile("OpportunityGroupWithBlankName"); // executionLog.WriteInExcel("Opportunity Group With Blank Name", Status, JIRA, "Opportunities Management"); //} }
public void activitiesMeetingsManagement() { 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 officeActivities_MeetingHelper = new OfficeActivities_MeetingHelper(GetWebDriver()); var office_ClientsHelper = new Office_ClientsHelper(GetWebDriver()); var office_LeadsHelper = new Office_LeadsHelper(GetWebDriver()); var office_OpportunitiesHelper = new Office_OpportunitiesHelper(GetWebDriver()); var ticket_CreateATicketHelper = new OfficeTickets_CreateTicketsHelper(GetWebDriver()); // Random Variables. var Subject = "Meeting" + GetRandomNumber(); var file = GetPathToFile() + "2.pdf"; String JIRA = ""; String Status = "Pass"; try { executionLog.Log("ActivitiesMeetingsManagement", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("ActivitiesMeetingsManagement", "Verify Page title"); VerifyTitle("Dashboard"); executionLog.Log("ActivitiesMeetingsManagement", "Go to create meetings page"); VisitOffice("meetings/create"); officeActivities_MeetingHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesMeetingsManagement", "Verify page title."); VerifyTitle("Create a Meeting"); executionLog.Log("ActivitiesMeetingsManagement", "Click On Save button"); officeActivities_MeetingHelper.ClickElement("Save"); executionLog.Log("ActivitiesMeetingsManagement", "Verify validation text for mandatoryness."); officeActivities_MeetingHelper.VerifyText("NameError", "This field is required."); executionLog.Log("ActivitiesMeetingsManagement", "Verify validation text for mandatoryness."); officeActivities_MeetingHelper.VerifyText("StartDateError", "This field is required."); executionLog.Log("ActivitiesMeetingsManagement", "Verify validation text for mandatoryness."); officeActivities_MeetingHelper.VerifyText("ParentError", "This field is required."); executionLog.Log("ActivitiesMeetingsManagement", "Enter Subject for the meeting"); officeActivities_MeetingHelper.TypeText("Subject", Subject); executionLog.Log("ActivitiesMeetingsManagement", "Enter location of meeting."); officeActivities_MeetingHelper.TypeText("Location", "Test Location"); executionLog.Log("ActivitiesMeetingsManagement", "Enter start date."); officeActivities_MeetingHelper.TypeText("StartDate", "12/30/2016"); executionLog.Log("ActivitiesMeetingsManagement", "Enter End Date."); officeActivities_MeetingHelper.TypeText("EndDate", "12/22/2016"); executionLog.Log("ActivitiesMeetingsManagement", "Select Related To"); officeActivities_MeetingHelper.SelectByText("RelatedTo", "Client"); executionLog.Log("ActivitiesMeetingsManagement", "Click On find list icon"); officeActivities_MeetingHelper.ClickElement("FindListIcon"); officeActivities_MeetingHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesMeetingsManagement", "Click on client for which meeting is created."); officeActivities_MeetingHelper.ClickElement("ClickOnClientMeeting"); officeActivities_MeetingHelper.WaitForWorkAround(1000); executionLog.Log("ActivitiesMeetingsManagement", "Click On Save button"); officeActivities_MeetingHelper.ClickElement("Save"); executionLog.Log("ActivitiesMeetingsManagement", "Click On Save button"); officeActivities_MeetingHelper.VerifyAlertText("Start Date & Time should lesser than or equal to Due Date & Time."); officeActivities_MeetingHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesMeetingsManagement", "Click On Save button"); officeActivities_MeetingHelper.AcceptAlert(); executionLog.Log("ActivitiesMeetingsManagement", "Enter start date"); officeActivities_MeetingHelper.TypeText("StartDate", "12/22/2016"); executionLog.Log("ActivitiesMeetingsManagement", "Enter End Date."); officeActivities_MeetingHelper.TypeText("EndDate", "12/30/2016"); executionLog.Log("ActivitiesMeetingsManagement", "Click On Save button"); officeActivities_MeetingHelper.ClickElement("Save"); executionLog.Log("ActivitiesMeetingsManagement", "verify page text"); officeActivities_MeetingHelper.WaitForText("Meeting saved successfully.", 10); executionLog.Log("ActivitiesMeetingsManagement", "Redirect at clients page."); VisitOffice("clients"); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesMeetingsManagement", "Click on any client."); office_ClientsHelper.ClickElement("Client1"); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesMeetingsManagement", "Select actitivity type as meetings."); office_ClientsHelper.Select("SelectActivityType", "Meetings"); office_ClientsHelper.WaitForWorkAround(1000); executionLog.Log("ActivitiesMeetingsManagement", "Enter ticket name to be search."); office_ClientsHelper.TypeText("ActivitySubject", Subject); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesMeetingsManagement", "Verify created meeting present on client page."); office_ClientsHelper.IsElementPresent("OpenFirstActivity"); executionLog.Log("ActivitiesMeetingsManagement", "Redirect at meetings page."); VisitOffice("meetings"); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesMeetingsManagement", "Search meeting by subject"); officeActivities_MeetingHelper.TypeText("SearchSubject", Subject); officeActivities_MeetingHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesMeetingsManagement", "select all in owner fiedld"); officeActivities_MeetingHelper.SelectByText("Owner", "All"); officeActivities_MeetingHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesMeetingsManagement", "Click on Edit"); officeActivities_MeetingHelper.ClickElement("Edit"); officeActivities_MeetingHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesMeetingsManagement", "Verify page title."); VerifyTitle("Edit Meeting"); executionLog.Log("ActivitiesMeetingsManagement", "Select meeting parent as lead"); officeActivities_MeetingHelper.SelectByText("RelatedTo", "Lead"); officeActivities_MeetingHelper.WaitForWorkAround(1000); executionLog.Log("ActivitiesMeetingsManagement", "Click On find list icon"); officeActivities_MeetingHelper.ClickElement("FindListIcon"); officeActivities_MeetingHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesMeetingsManagement", "Click on lead for which meeting is created."); officeActivities_MeetingHelper.ClickElement("ClickOnClientMeeting"); officeActivities_MeetingHelper.WaitForWorkAround(1000); executionLog.Log("ActivitiesMeetingsManagement", "Edit end Date"); officeActivities_MeetingHelper.TypeText("EndDate", "1/1/2017"); executionLog.Log("ActivitiesMeetingsManagement", "Click On Save button"); officeActivities_MeetingHelper.ClickElement("Save"); executionLog.Log("ActivitiesMeetingsManagement", "Wait for updation success."); officeActivities_MeetingHelper.WaitForText("Meeting updated successfully.", 10); executionLog.Log("ActivitiesMeetingsManagement", "Redirect at leads page."); VisitOffice("leads"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesMeetingsManagement", "Click On any lead."); office_LeadsHelper.ClickElement("ClickAnyLead"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesMeetingsManagement", "Select actitivity type as meetings."); office_LeadsHelper.Select("SelectActivityType", "Meetings"); office_LeadsHelper.WaitForWorkAround(1000); executionLog.Log("ActivitiesMeetingsManagement", "Enter meeting name to be search."); office_LeadsHelper.TypeText("ActivitySubject", Subject); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesMeetingsManagement", "Verify created meeting present on leads page."); office_LeadsHelper.IsElementPresent("ClickNotes1"); executionLog.Log("ActivitiesMeetingsManagement", "Redirect at meetings page."); VisitOffice("meetings"); officeActivities_MeetingHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesMeetingsManagement", "Search meeting by subject"); officeActivities_MeetingHelper.TypeText("SearchSubject", Subject); officeActivities_MeetingHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesMeetingsManagement", "select all in owner fiedld"); officeActivities_MeetingHelper.SelectByText("Owner", "All"); officeActivities_MeetingHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesMeetingsManagement", "Click on Edit"); officeActivities_MeetingHelper.ClickElement("Edit"); officeActivities_MeetingHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesMeetingsManagement", "Verify page title."); VerifyTitle("Edit Meeting"); executionLog.Log("ActivitiesMeetingsManagement", "Select parent type to opportunity"); officeActivities_MeetingHelper.SelectByText("RelatedTo", "Opportunity"); officeActivities_MeetingHelper.WaitForWorkAround(1000); executionLog.Log("ActivitiesMeetingsManagement", "Click On find list icon"); officeActivities_MeetingHelper.ClickElement("FindListIcon"); officeActivities_MeetingHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesMeetingsManagement", "Click on opportunity for which meeting is created."); officeActivities_MeetingHelper.ClickElement("ClickOnClientMeeting"); officeActivities_MeetingHelper.WaitForWorkAround(1000); executionLog.Log("ActivitiesMeetingsManagement", "Click On Save button"); officeActivities_MeetingHelper.ClickElement("Save"); executionLog.Log("ActivitiesMeetingsManagement", "Wait for updation success message."); officeActivities_MeetingHelper.WaitForText("Meeting updated successfully.", 10); executionLog.Log("ActivitiesMeetingsManagement", "Redirect at opportunities page."); VisitOffice("opportunities"); office_OpportunitiesHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesMeetingsManagement", "Click On any opportunity."); office_OpportunitiesHelper.ClickElement("Opportunities1"); office_OpportunitiesHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesMeetingsManagement", "Select actitivity type as meetings"); office_LeadsHelper.Select("SelectActivityType", "Meetings"); office_OpportunitiesHelper.WaitForWorkAround(1000); executionLog.Log("ActivitiesMeetingsManagement", "Enter meeting name to be search."); office_OpportunitiesHelper.TypeText("ActivitySubject", Subject); office_OpportunitiesHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesMeetingsManagement", "Verify created opportunity present on opportunity page"); office_OpportunitiesHelper.IsElementPresent("OpenOpportunity"); executionLog.Log("ActivitiesMeetingsManagement", "Redirect at meetings page."); VisitOffice("meetings"); officeActivities_MeetingHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesMeetingsManagement", "Search meeting by subject"); officeActivities_MeetingHelper.TypeText("SearchSubject", Subject); officeActivities_MeetingHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesMeetingsManagement", "select all in owner fiedld"); officeActivities_MeetingHelper.SelectByText("Owner", "All"); officeActivities_MeetingHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesMeetingsManagement", "Click on Edit"); officeActivities_MeetingHelper.ClickElement("Edit"); officeActivities_MeetingHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesMeetingsManagement", "Verify page title."); VerifyTitle("Edit Meeting"); executionLog.Log("ActivitiesMeetingsManagement", "Select parent type for meeting."); officeActivities_MeetingHelper.SelectByText("RelatedTo", "Ticket"); officeActivities_MeetingHelper.WaitForWorkAround(1000); executionLog.Log("ActivitiesMeetingsManagement", "Click On find list icon"); officeActivities_MeetingHelper.ClickElement("FindListIcon"); officeActivities_MeetingHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesMeetingsManagement", "Click on ticket for which meeting is created."); officeActivities_MeetingHelper.ClickElement("ClickOnClientMeeting"); officeActivities_MeetingHelper.WaitForWorkAround(1000); executionLog.Log("ActivitiesMeetingsManagement", "Click On Save button"); officeActivities_MeetingHelper.ClickElement("Save"); executionLog.Log("ActivitiesMeetingsManagement", "Wait for success message."); officeActivities_MeetingHelper.WaitForText("Meeting updated successfully.", 10); executionLog.Log("ActivitiesMeetingsManagement", "Redirect at tickets page."); VisitOffice("tickets"); executionLog.Log("ActivitiesMeetingsManagement", "Click On any ticket."); ticket_CreateATicketHelper.ClickElement("Ticket1"); executionLog.Log("ActivitiesMeetingsManagement", "Select actitivity type as meetings"); office_LeadsHelper.Select("SelectActivityType", "Meetings"); executionLog.Log("ActivitiesMeetingsManagement", "Enter ticket name to be search."); office_OpportunitiesHelper.TypeText("ActivitySubject", Subject); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesMeetingsManagement", "Click on ticket to view details"); ticket_CreateATicketHelper.IsElementPresent("OpenTicket"); executionLog.Log("ActivitiesMeetingsManagement", "Redirect at meetings page."); VisitOffice("meetings"); executionLog.Log("ActivitiesMeetingsManagement", "Search meeting by subject"); officeActivities_MeetingHelper.TypeText("SearchSubject", Subject); officeActivities_MeetingHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesMeetingsManagement", "select all in owner fiedld"); officeActivities_MeetingHelper.SelectByText("Owner", "All"); officeActivities_MeetingHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesMeetingsManagement", "Click on the meeting"); officeActivities_MeetingHelper.ClickElement("ClickOnAnyMeeting"); executionLog.Log("ActivitiesMeetingsManagement", "Click On Cance meeting."); officeActivities_MeetingHelper.ClickElement("CancelMeeting"); officeActivities_MeetingHelper.AcceptAlert(); executionLog.Log("ActivitiesMeetingsManagement", "Redirect at recycle bin."); VisitOffice("meetings/recyclebin"); executionLog.Log("ActivitiesMeetingsManagement", "Verify page title"); VerifyTitle("Recycled Meeting"); executionLog.Log("ActivitiesMeetingsManagement", "Search meeting by name."); officeActivities_MeetingHelper.TypeText("SearchSubject", Subject); officeActivities_MeetingHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesMeetingsManagement", "select all in owner fiedld"); officeActivities_MeetingHelper.SelectByText("OwnerField", "All"); officeActivities_MeetingHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesMeetingsManagement", "Wait for delete icon to be present."); officeActivities_MeetingHelper.WaitForElementPresent("DeleteMeetingPermanently", 10); executionLog.Log("ActivitiesMeetingsManagement", "Click On delete icon"); officeActivities_MeetingHelper.ClickElement("DeleteMeetingPermanently"); executionLog.Log("ActivitiesMeetingsManagement", "Accept alert message."); officeActivities_MeetingHelper.AcceptAlert(); executionLog.Log("ActivitiesMeetingsManagement", "Verify text."); officeActivities_MeetingHelper.WaitForText("Meeting Permanently Deleted.", 10); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("ActivitiesMeetingsManagement"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Activities Meetings Management"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Activities Meetings Management", "Bug", "Medium", "Meeting page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Activities Meetings Management"); TakeScreenshot("ActivitiesMeetingsManagement"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\ActivitiesMeetingsManagement.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("ActivitiesMeetingsManagement"); string id = loginHelper.getIssueID("Activities Meetings Management"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\ActivitiesMeetingsManagement.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Activities Meetings Management"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Activities Meetings Management"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("ActivitiesMeetingsManagement"); executionLog.WriteInExcel("Activities Meetings Management", Status, JIRA, "Office Activities"); } }
public void zipCodeError() { 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_OpportunitiesHelper = new Office_OpportunitiesHelper(GetWebDriver()); var office_LeadsHelper = new Office_LeadsHelper(GetWebDriver()); var office_ClientsHelper = new Office_ClientsHelper(GetWebDriver()); String JIRA = ""; String Status = "Pass"; var DBA = "DBA" + GetRandomNumber(); try { executionLog.Log("ZipCodeError", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("ZipCodeError", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("ZipCodeError", "Go to Create Opportunity page"); VisitOffice("opportunities/create"); executionLog.Log("ZipCodeError", "Verify title"); VerifyTitle("Create an Opportunity"); executionLog.Log("ZipCodeError", "Enter zip code"); office_OpportunitiesHelper.TypeText("ZipCode", "60601"); executionLog.Log("ZipCodeError", "Click On anywhere"); office_OpportunitiesHelper.ClickElement("V"); executionLog.Log("ZipCodeError", "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("ZipCodeError"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Zip Code Error"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Zip Code Error", "Bug", "Medium", "Client/Leads page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Zip Code Error"); TakeScreenshot("ZipCodeError"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\ZipCodeError.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("ZipCodeError"); string id = loginHelper.getIssueID("Zip Code Error"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\ZipCodeError.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Zip Code Error"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Zip Code Error"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("ZipCodeError"); executionLog.WriteInExcel("Zip Code Error", Status, JIRA, "Leads/Clients Management"); } }
public void opportunityToLeadConversionIssue() { 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_OpportunitiesHelper = new Office_OpportunitiesHelper(GetWebDriver()); username = oXMLData.getData("settings/Credentials", "username_office"); password = oXMLData.getData("settings/Credentials", "password"); // Variable var Oppname = "Test" + RandomNumber(99, 99999); var CDBA = "New" + RandomNumber(99, 99999); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("OpportunityToLeadConversionIssue", "Login with valid credential Username"); Login(username[0], password[0]); executionLog.Log("OpportunityToLeadConversionIssue", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("OpportunityToLeadConversionIssue", "Create Opportunities"); VisitOffice("opportunities/create"); executionLog.Log("OpportunityToLeadConversionIssue", "Click on Save"); office_OpportunitiesHelper.ClickElement("SaveOpp"); office_OpportunitiesHelper.WaitForWorkAround(2000); executionLog.Log("OpportunityToLeadConversionIssue", "Verify text on page."); office_OpportunitiesHelper.VerifyText("RequiredFieldsOpp", "This field is required."); executionLog.Log("OpportunityToLeadConversionIssue", "Enter Opportunity Name"); office_OpportunitiesHelper.TypeText("Name", Oppname); executionLog.Log("OpportunityToLeadConversionIssue", "Enter Company DBA Name"); office_OpportunitiesHelper.TypeText("CompanyName", CDBA); executionLog.Log("OpportunityToLeadConversionIssue", "Select Opp Status"); office_OpportunitiesHelper.SelectByText("State", "New"); executionLog.Log("OpportunityToLeadConversionIssue", "Select Opp Responsibility"); office_OpportunitiesHelper.SelectByText("Responsibility", "Howard Tang"); executionLog.Log("OpportunityToLeadConversionIssue", "Click on Save"); office_OpportunitiesHelper.ClickElement("SaveOpp"); office_OpportunitiesHelper.WaitForWorkAround(3000); executionLog.Log("OpportunityToLeadConversionIssue", "Wait for success message"); office_OpportunitiesHelper.WaitForText("Opportunity saved successfully.", 10); executionLog.Log("OpportunityToLeadConversionIssue", "Click on convert."); office_OpportunitiesHelper.ClickElement("Convert"); executionLog.Log("OpportunityToLeadConversionIssue", "Click on radio button lead."); office_OpportunitiesHelper.ClickElement("LeadRadio"); executionLog.Log("OpportunityToLeadConversionIssue", "Click on save button."); office_OpportunitiesHelper.clickJS("SaveConfirm"); office_OpportunitiesHelper.WaitForWorkAround(5000); executionLog.Log("OpportunityToLeadConversionIssue", "Verify converted name present on lead page."); office_OpportunitiesHelper.VerifyName(Oppname); office_OpportunitiesHelper.WaitForWorkAround(3000); executionLog.Log("OpportunityToLeadConversionIssue", "Verify converted DBA name present on the page."); office_OpportunitiesHelper.VerifyCompName(CDBA); office_OpportunitiesHelper.WaitForWorkAround(4000); VisitOffice("logout"); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("OpportunityToLeadConversionIssue"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("OpportunityToLeadConversionIssue"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Opportunities", "Bug", "Medium", "Opportunity page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("OpportunityToLeadConversionIssue"); TakeScreenshot("OpportunityToLeadConversionIssue"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\OpportunityToLeadConversionIssue.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("OpportunityToLeadConversionIssue"); string id = loginHelper.getIssueID("OpportunityToLeadConversionIssue"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\OpportunityToLeadConversionIssue.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("OpportunityToLeadConversionIssue"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("OpportunityToLeadConversionIssue"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("OpportunityToLeadConversionIssue"); executionLog.WriteInExcel("OpportunityToLeadConversionIssue", Status, JIRA, "Opportunities management"); } }
public void activitiesNotesManagement() { 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 var executionLog = new ExecutionLog(); var loginHelper = new LoginHelper(GetWebDriver()); var officeActivities_NotesHelper = new OfficeActivities_NotesHelper(GetWebDriver()); var office_ClientsHelper = new Office_ClientsHelper(GetWebDriver()); var office_LeadsHelper = new Office_LeadsHelper(GetWebDriver()); var office_OpportunitiesHelper = new Office_OpportunitiesHelper(GetWebDriver()); var ticket_CreateATicketHelper = new OfficeTickets_CreateTicketsHelper(GetWebDriver()); // Variable var name = "Note" + RandomNumber(1, 99); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("ActivitiesNotesManagement", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("ActivitiesNotesManagement", "Verify Page title"); VerifyTitle("Dashboard"); executionLog.Log("ActivitiesNotesManagement", "Redirect at admin page."); VisitOffice("admin"); executionLog.Log("ActivitiesNotesManagement", "Go to notes page"); VisitOffice("notes"); officeActivities_NotesHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesNotesManagement", "Verify page title"); VerifyTitle("Notes"); executionLog.Log("ActivitiesNotesManagement", " Click On Create"); officeActivities_NotesHelper.ClickElement("Create"); officeActivities_NotesHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesNotesManagement", "Verify page title"); VerifyTitle("Create a New Note"); executionLog.Log("ActivitiesNotesManagement", "Click on Save "); officeActivities_NotesHelper.ClickElement("Save"); executionLog.Log("ActivitiesNotesManagement", "Verify validation text for subject."); officeActivities_NotesHelper.VerifyText("SubjectError", "This field is required."); executionLog.Log("ActivitiesNotesManagement", "Enter note subject."); officeActivities_NotesHelper.TypeText("Subject", name); executionLog.Log("ActivitiesNotesManagement", "Click on save."); officeActivities_NotesHelper.ClickElement("Save"); executionLog.Log("ActivitiesNotesManagement", "Wait for success text"); officeActivities_NotesHelper.WaitForText("Note saved successfully. ", 10); officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesNotesManagement", "Enter Subject in Search field"); officeActivities_NotesHelper.TypeText("EnterSubject", name); officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesNotesManagement", "Select All in created by field"); officeActivities_NotesHelper.SelectByText("CreatedbyField", "All"); officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesNotesManagement", "Click on Edit"); officeActivities_NotesHelper.ClickElement("Edit"); VerifyTitle("Edit Note"); executionLog.Log("ActivitiesNotesManagement", "Select note parent"); officeActivities_NotesHelper.Select("NoteParent", "20"); executionLog.Log("ActivitiesNotesManagement", "Click on find list icon."); officeActivities_NotesHelper.ClickElement("SelectClient"); officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesNotesManagement", " Click On any client."); officeActivities_NotesHelper.ClickElement("ClickONClientNS"); officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesNotesManagement", "Click on save button."); officeActivities_NotesHelper.ClickElement("Save"); executionLog.Log("ActivitiesNotesManagement", "Verify note updated successfully"); officeActivities_NotesHelper.WaitForText("Note Updated Success.", 10); executionLog.Log("ActivitiesNotesManagement", "Redirect at clients page."); VisitOffice("clients"); officeActivities_NotesHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesNotesManagement", "Click on any client."); office_ClientsHelper.ClickElement("Client1"); officeActivities_NotesHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesNotesManagement", "Select actitivity type as notes."); office_ClientsHelper.Select("SelectActivityType", "Notes"); executionLog.Log("ActivitiesNotesManagement", "Enter note name to be search."); office_ClientsHelper.TypeText("ActivitySubject", name); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesNotesManagement", "Verify created note present on client page."); office_ClientsHelper.IsElementPresent("OpenFirstActivity"); executionLog.Log("ActivitiesNotesManagement", "Go to note page"); VisitOffice("notes"); officeActivities_NotesHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesNotesManagement", "Verify page title"); VerifyTitle("Notes"); //officeActivities_NotesHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesNotesManagement", "Enter Subject in Search field"); officeActivities_NotesHelper.TypeText("EnterSubject", name); officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesNotesManagement", "Select All in created by field"); officeActivities_NotesHelper.SelectByText("CreatedbyField", "All"); officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesNotesManagement", "Click on Edit"); officeActivities_NotesHelper.ClickElement("Edit"); officeActivities_NotesHelper.WaitForWorkAround(3000); VerifyTitle("Edit Note"); executionLog.Log("ActivitiesNotesManagement", "Select note parent as lead."); officeActivities_NotesHelper.Select("NoteParent", "14"); executionLog.Log("ActivitiesNotesManagement", "Click on find list icon."); officeActivities_NotesHelper.ClickElement("SelectClient"); officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesNotesManagement", " Click On any opportunity"); officeActivities_NotesHelper.ClickElement("ClickONClientNS"); officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesNotesManagement", "Click on save button."); officeActivities_NotesHelper.ClickElement("Save"); executionLog.Log("ActivitiesNotesManagement", "Verify note updated successfully"); officeActivities_NotesHelper.WaitForText("Note Updated Success.", 10); executionLog.Log("ActivitiesNotesManagement", "Redirect at leads page."); VisitOffice("leads"); officeActivities_NotesHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesNotesManagement", "Click On any lead."); office_LeadsHelper.ClickElement("ClickAnyLead"); officeActivities_NotesHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesNotesManagement", "Select actitivity type as notes."); office_LeadsHelper.Select("SelectActivityType", "Notes"); executionLog.Log("ActivitiesNotesManagement", "Enter note name to be search."); office_LeadsHelper.TypeText("ActivitySubject", name); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesNotesManagement", "Select All in created by field"); office_LeadsHelper.SelectByText("CreatedByField", "All"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesNotesManagement", "Verify created note present on leads page."); office_LeadsHelper.IsElementPresent("ClickNotes1"); executionLog.Log("ActivitiesNotesManagement", "Go to note page"); VisitOffice("notes"); officeActivities_NotesHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesNotesManagement", "Verify page title"); VerifyTitle("Notes"); executionLog.Log("ActivitiesNotesManagement", "Enter Subject in Search field"); officeActivities_NotesHelper.TypeText("EnterSubject", name); officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesNotesManagement", "Select All in created by field"); officeActivities_NotesHelper.SelectByText("CreatedbyField", "All"); officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesNotesManagement", "Click on Edit"); officeActivities_NotesHelper.ClickElement("Edit"); VerifyTitle("Edit Note"); executionLog.Log("ActivitiesNotesManagement", "Select note parent as opportunity."); officeActivities_NotesHelper.Select("NoteParent", "15"); executionLog.Log("ActivitiesNotesManagement", "Click on findlist icon."); officeActivities_NotesHelper.ClickElement("SelectClient"); officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesNotesManagement", " Click On any opportunity"); officeActivities_NotesHelper.ClickElement("ClickONClientNS"); officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesNotesManagement", "Edit on Save Btn"); officeActivities_NotesHelper.ClickElement("Save"); executionLog.Log("ActivitiesNotesManagement", "Verify note updated successfully"); officeActivities_NotesHelper.WaitForText("Note Updated Success.", 10); executionLog.Log("ActivitiesNotesManagement", "Redirect at opportunities page."); VisitOffice("opportunities"); officeActivities_NotesHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesNotesManagement", "Click On any opportunity."); office_OpportunitiesHelper.ClickElement("Opportunities1"); officeActivities_NotesHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesNotesManagement", "Select actitivity type as notes"); office_LeadsHelper.Select("SelectActivityType", "Notes"); executionLog.Log("ActivitiesNotesManagement", "Enter notes name to be search."); office_OpportunitiesHelper.TypeText("ActivitySubject", name); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesNotesManagement", "Select All in created by field"); office_OpportunitiesHelper.SelectByText("CreateByField", "All"); office_OpportunitiesHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesNotesManagement", "Verify created note present on opportunity page"); office_OpportunitiesHelper.IsElementPresent("OpenOpportunity"); executionLog.Log("ActivitiesNotesManagement", "Go to note page"); VisitOffice("notes"); officeActivities_NotesHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesNotesManagement", "Verify title"); VerifyTitle("Notes"); executionLog.Log("ActivitiesNotesManagement", "Enter Subject in Search field"); officeActivities_NotesHelper.TypeText("EnterSubject", name); officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesNotesManagement", "Select All in created by field"); officeActivities_NotesHelper.SelectByText("CreatedbyField", "All"); officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesNotesManagement", "Click on Edit"); officeActivities_NotesHelper.ClickElement("Edit"); VerifyTitle("Edit Note"); executionLog.Log("ActivitiesNotesManagement", "Select note parent as tickets."); officeActivities_NotesHelper.Select("NoteParent", "36"); executionLog.Log("ActivitiesNotesManagement", "Click on find list icon."); officeActivities_NotesHelper.ClickElement("SelectClient"); officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesNotesManagement", " Click On any ticket."); officeActivities_NotesHelper.ClickElement("ClickONClientNS"); officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesNotesManagement", "Edit on Save Btn"); officeActivities_NotesHelper.ClickElement("Save"); executionLog.Log("ActivitiesNotesManagement", "Verify note updated successfully"); officeActivities_NotesHelper.WaitForText("Note Updated Success.", 10); executionLog.Log("ActivitiesNotesManagement", "Redirect at tickets page."); VisitOffice("tickets"); officeActivities_NotesHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesNotesManagement", "Click On any ticket."); ticket_CreateATicketHelper.ClickElement("Ticket1"); officeActivities_NotesHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesNotesManagement", "Select actitivity type as notes"); office_LeadsHelper.Select("SelectActivityType", "Notes"); executionLog.Log("ActivitiesNotesManagement", "Enter ticket name to be search."); office_OpportunitiesHelper.TypeText("ActivitySubject", name); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesNotesManagement", "Select All in created by field"); office_OpportunitiesHelper.SelectByText("CreateByField", "All"); office_OpportunitiesHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesNotesManagement", "Verify created note present on ticket page."); ticket_CreateATicketHelper.IsElementPresent("OpenTicket"); executionLog.Log("ActivitiesNotesManagement", "Go to note page"); VisitOffice("notes"); officeActivities_NotesHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesNotesManagement", "Verify page title."); VerifyTitle("Notes"); executionLog.Log("ActivitiesNotesManagement", "Enter Subject in Search field"); officeActivities_NotesHelper.TypeText("EnterSubject", name); officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesNotesManagement", "Select All in created by field"); officeActivities_NotesHelper.SelectByText("CreatedbyField", "All"); officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesNotesManagement", "Select First Note"); officeActivities_NotesHelper.ClickElement("SelectNote1"); officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesNotesManagement", "Click Delete btn "); officeActivities_NotesHelper.ClickElement("DeleteNote"); executionLog.Log("ActivitiesNotesManagement", "Accept alert message. "); officeActivities_NotesHelper.AcceptAlert(); executionLog.Log("ActivitiesNotesManagement", "Wait for delete message. "); officeActivities_NotesHelper.WaitForText("Note deleted successfully", 10); executionLog.Log("ActivitiesNotesManagement", "Redirect to recycle bin"); VisitOffice("notes/recyclebin"); officeActivities_NotesHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesNotesManagement", "Enter Subject in Search field"); officeActivities_NotesHelper.TypeText("EnterSubject", name); officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesNotesManagement", "Select All in created by field"); officeActivities_NotesHelper.SelectByText("CreatedbyField", "All"); officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesNotesManagement", "Click on delete icon."); officeActivities_NotesHelper.ClickElement("DeleteNoteRBin"); //officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesNotesManagement", "Accept alert message."); officeActivities_NotesHelper.AcceptAlert(); //officeActivities_NotesHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesNotesManagement", "Wait for success message."); officeActivities_NotesHelper.WaitForText("Note Permanently Deleted.", 5); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("ActivitiesNotesManagement"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Activities Notes Management"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Activities Notes Management", "Bug", "Medium", "Notes page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Activities Notes Management"); TakeScreenshot("ActivitiesNotesManagement"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\ActivitiesNotesManagement.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("ActivitiesNotesManagement"); string id = loginHelper.getIssueID("Activities Notes Management"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\ActivitiesNotesManagement.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Activities Notes Management"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Activities Notes Management"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("ActivitiesNotesManagement"); executionLog.WriteInExcel("Activities Notes Management", Status, JIRA, "Office Activities"); } }