public void verifyOpportunityAddressLabel() { 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()); // Random Variable. String JIRA = ""; String Status = "Pass"; try { executionLog.Log("VerifyOpportunityAddressLabel", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("VerifyOpportunityAddressLabel", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("VerifyOpportunityAddressLabel", "Redirect at opportunities page."); VisitOffice("opportunities"); executionLog.Log("VerifyOpportunityAddressLabel", "Click on Create button"); office_OpportunitiesHelper.ClickElement("Create"); executionLog.Log("VerifyOpportunityAddressLabel", "Verify Address Line 1 label"); office_OpportunitiesHelper.VerifyText("AddressLine1Label", "Address Line 1:"); } catch (Exception e) { } }
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 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 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 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 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 opportunityLabelAgentBlankSave() { 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()); // Random Variable. String JIRA = ""; String Status = "Pass"; try { executionLog.Log("OpportunityLabelAgentBlankSave", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("OpportunityLabelAgentBlankSave", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("OpportunityLabelAgentBlankSave", "Redirect at opportunities page."); VisitOffice("opportunities"); executionLog.Log("OpportunityLabelAgentBlankSave", "Click on any Opportunity"); office_OpportunitiesHelper.ClickElement("Opportunities1"); executionLog.Log("OpportunityLabelAgentBlankSave", "Click to add partner agent"); office_OpportunitiesHelper.DoubleClick("//*[@id='partner']"); office_OpportunitiesHelper.WaitForWorkAround(1000); executionLog.Log("OpportunityLabelAgentBlankSave", "Click on save"); office_OpportunitiesHelper.ClickElement("SaveQuicklook"); executionLog.Log("OpportunityLabelAgentBlankSave", "Verify label for Partner Agent"); office_OpportunitiesHelper.VerifyText("VerifyLabel", "Select"); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("OpportunityLabelAgentBlankSave"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Opportunity Label Agent Blank Save"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Opportunity Label Agent Blank Save", "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 Label Agent Blank Save"); TakeScreenshot("OpportunityLabelAgentBlankSave"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\OpportunityLabelAgentBlankSave.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("OpportunityLabelAgentBlankSave"); string id = loginHelper.getIssueID("Opportunity Label Agent Blank Save"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\OpportunityLabelAgentBlankSave.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Opportunity Label Agent Blank Save"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Opportunity Label Agent Blank Save"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("OpportunityLabelAgentBlankSave"); executionLog.WriteInExcel("Opportunity Label Agent Blank Save", 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 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 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 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"); //} }