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 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 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 blankSubjectValidation() { 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()); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("BlankSubjectValidation", "Login with valid username and password"); Login(username[0], password[0]); executionLog.Log("BlankSubjectValidation", "Verify Page title"); VerifyTitle("Dashboard"); executionLog.Log("BlankSubjectValidation", "Visit to Opportunities page"); VisitOffice("opportunities"); office_OpportunitiesHelper.WaitForWorkAround(5000); executionLog.Log("BlankSubjectValidation", "Verify title"); VerifyTitle("Opportunities"); executionLog.Log("BlankSubjectValidation", "Open an opportunities"); office_OpportunitiesHelper.ClickElement("Opportunities1"); office_OpportunitiesHelper.WaitForWorkAround(5000); executionLog.Log("BlankSubjectValidation", "Verify title"); VerifyTitle("Details"); office_OpportunitiesHelper.WaitForWorkAround(2000); executionLog.Log("BlankSubjectValidation", "Click on Add note button"); office_OpportunitiesHelper.ClickElement("AddNote"); office_OpportunitiesHelper.WaitForWorkAround(1000); executionLog.Log("BlankSubjectValidation", "Wait for text"); office_OpportunitiesHelper.WaitForText("Create a Note", 05); executionLog.Log("BlankSubjectValidation", "Click on Save button without subject"); office_OpportunitiesHelper.ClickElement("Save"); office_OpportunitiesHelper.WaitForWorkAround(1000); executionLog.Log("BlankSubjectValidation", "Verify validation message"); office_OpportunitiesHelper.WaitForText("This field is required", 10); executionLog.Log("BlankSubjectValidation", "Log out from the application"); VisitOffice("logout"); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("BlankSubjectValidation"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Blank Subject Validation"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Blank Subject Validation", "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("Blank Subject Validation"); TakeScreenshot("BlankSubjectValidation"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\BlankSubjectValidation.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("BlankSubjectValidation"); string id = loginHelper.getIssueID("Blank Subject Validation"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\BlankSubjectValidation.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Blank Subject Validation"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Blank Subject Validation"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("BlankSubjectValidation"); executionLog.WriteInExcel("Blank Subject Validation", Status, JIRA, "Office Opportunities"); } }
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 verifyCorrectNumberOfImportedOpportunity() { 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()); var path = GetPathToFile() + "opportunitysamples - Original.csv"; // Random Variable. String JIRA = ""; String Status = "Pass"; try { executionLog.Log("VerifyCorrectNumberOfImportedOpportunity", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("VerifyCorrectNumberOfImportedOpportunity", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("VerifyCorrectNumberOfImportedOpportunity", "Redirect at Import opportunities page."); VisitOffice("opportunities/import"); office_OpportunitiesHelper.WaitForWorkAround(3000); executionLog.Log("VerifyCorrectNumberOfImportedOpportunity", "Upload csv file"); office_OpportunitiesHelper.Upload("BrowseFile", path); office_OpportunitiesHelper.WaitForWorkAround(1000); executionLog.Log("VerifyCorrectNumberOfImportedOpportunity", "Click on Import button"); office_OpportunitiesHelper.ClickElement("ImportOpp."); office_OpportunitiesHelper.WaitForWorkAround(2000); executionLog.Log("VerifyCorrectNumberOfImportedOpportunity", "Verify message of import"); office_OpportunitiesHelper.WaitForText("4 Records Imported Successfully.", 10); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("VerifyCorrectNumberOfImportedOpportunity"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Verify Correct Number Of Imported Opportunity"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Verify Correct Number Of Imported Opportunity", "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("Verify Correct Number Of Imported Opportunity"); TakeScreenshot("VerifyCorrectNumberOfImportedOpportunity"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyCorrectNumberOfImportedOpportunity.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("VerifyCorrectNumberOfImportedOpportunity"); string id = loginHelper.getIssueID("Verify Correct Number Of Imported Opportunity"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyCorrectNumberOfImportedOpportunity.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Verify Correct Number Of Imported Opportunity"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Verify Correct Number Of Imported Opportunity"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("VerifyCorrectNumberOfImportedOpportunity"); executionLog.WriteInExcel("Verify Correct Number Of Imported Opportunity", Status, JIRA, "Opportunities Management"); } }
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 bulkUpdateSalesManagerForOpportunities() { 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 FirstName = "Test" + GetRandomNumber(); var LastName = "Tester" + GetRandomNumber(); var Number = "12345678" + GetRandomNumber(); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("BulkUpdateSalesManagerForOpportunities", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("BulkUpdateSalesManagerForOpportunities", "Verify Page title"); VerifyTitle("Dashboard"); office_OpportunitiesHelper.WaitForWorkAround(2000); executionLog.Log("BulkUpdateSalesManagerForOpportunities", "Visit opportunities page."); VisitOffice("opportunities"); office_OpportunitiesHelper.WaitForWorkAround(2000); executionLog.Log("BulkUpdateSalesManagerForOpportunities", "Verify page title.."); VerifyTitle("Opportunities"); office_OpportunitiesHelper.WaitForWorkAround(2000); executionLog.Log("BulkUpdateSalesManagerForOpportunities", "Click On first Check Box"); office_OpportunitiesHelper.ClickElement("CheckboxOpportunity"); office_OpportunitiesHelper.WaitForWorkAround(2000); executionLog.Log("BulkUpdateSalesManagerForOpportunities", "Click On Bulk Update"); office_OpportunitiesHelper.ClickElement("ClickOnBulkUpdate"); office_OpportunitiesHelper.WaitForWorkAround(2000); executionLog.Log("BulkUpdateSalesManagerForOpportunities", "Change Sale Manager"); office_OpportunitiesHelper.ClickElement("ChangeSaleManager"); office_OpportunitiesHelper.WaitForWorkAround(2000); executionLog.Log("BulkUpdateSalesManagerForOpportunities", "Select Sales Manager"); office_OpportunitiesHelper.SelectDropDownByText("//*[@id='OpportunitySalesManagerUpdateSalesManagerId']", "Howard Tang"); office_OpportunitiesHelper.WaitForWorkAround(2000); executionLog.Log("BulkUpdateSalesManagerForOpportunities", "Click on Update button"); office_OpportunitiesHelper.ClickDisplayed("//button[text()='Update']"); office_OpportunitiesHelper.WaitForWorkAround(2000); executionLog.Log("BulkUpdateSalesManagerForOpportunities", "Accept alert message."); office_OpportunitiesHelper.AcceptAlert(); office_OpportunitiesHelper.WaitForWorkAround(2000); executionLog.Log("BulkUpdateSalesManagerForOpportunities", "Wait for success message."); office_OpportunitiesHelper.WaitForText("records updated successfully", 30); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("BulkUpdateSalesManagerForOpportunities"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Bulk Update Sales Manager For Opportunities"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Bulk Update Sales Manager For Opportunities", "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("Bulk Update Sales Manager For Opportunities"); TakeScreenshot("BulkUpdateSalesManagerForOpportunities"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\BulkUpdateSalesManagerForOpportunities.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("BulkUpdateSalesManagerForOpportunities"); string id = loginHelper.getIssueID("Bulk Update Sales Manager For Opportunities"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\BulkUpdateSalesManagerForOpportunities.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Bulk Update Sales Manager For Opportunities"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Bulk Update Sales Manager For Opportunities"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("BulkUpdateSalesManagerForOpportunities"); executionLog.WriteInExcel("Bulk Update Sales Manager For Opportunities", Status, JIRA, "Opportunities Management"); } }
public void opportunitiesUrlChange() { 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("OpportunitiesUrlChange", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("OpportunitiesUrlChange", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("OpportunitiesUrlChange", "Goto User Opportunities"); VisitOffice("opportunities"); executionLog.Log("OpportunitiesUrlChange", "Click On Any Opportunity"); office_OpportunitiesHelper.ClickElement("OpenOpportunity"); office_OpportunitiesHelper.WaitForWorkAround(2000); executionLog.Log("OpportunitiesUrlChange", "Change the url with the url number of another office"); VisitOffice("opportunities/view/63347"); executionLog.Log("OpportunitiesUrlChange", "Verify Validation"); office_OpportunitiesHelper.WaitForText("You don't have privileges to View this Opportunity.", 10); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("OpportunitiesUrlChange"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Opportunities Url Change"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Opportunities Url Change", "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 Url Change"); TakeScreenshot("OpportunitiesUrlChange"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\OpportunitiesUrlChange.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("OpportunitiesUrlChange"); string id = loginHelper.getIssueID("Opportunities Url Change"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\OpportunitiesUrlChange.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Opportunities Url Change"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Opportunities Url Change"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("OpportunitiesUrlChange"); executionLog.WriteInExcel("Opportunities Url Change", Status, JIRA, "Office opportunities"); } }