public void ChangeTheme(string theme) { Thread.Sleep(2000); GetWebDriver().Navigate().GoToUrl("https://www.pegasus-test.com/selcorp/seloffice/themes"); LoginHelper loginHelper = new LoginHelper(GetWebDriver()); VerifyTitle("Themes"); if (theme == "Old") { if (loginHelper.IsElementPresent("//*[@id='menu']/li[1]/a")) { Console.WriteLine("New theme"); loginHelper.WaitForElementVisible("//table[@id='list1']/tbody/tr[3]/td[5]/a[1]/i", 30); loginHelper.Click("//table[@id='list1']/tbody/tr[3]/td[5]/a[1]/i"); loginHelper.WaitForText("Theme is successfully changed as default theme.", 30); } } else { if (!loginHelper.IsElementPresent("//*[@id='menu']/li[1]/a")) { Console.WriteLine("Old theme"); loginHelper.WaitForElementVisible("//table[@id='list1']/tbody/tr[3]/td[5]/a[1]/img",30); loginHelper.Click("//table[@id='list1']/tbody/tr[3]/td[5]/a[1]/img"); loginHelper.WaitForText("Theme is successfully changed as default theme.", 30); } } VerifyTitle("Themes"); GetWebDriver().Navigate().GoToUrl("https://www.pegasus-test.com/selcorp/seloffice"); }
// Login into the application public void Login(string userName, string password) { LoginHelper = new LoginHelper(GetWebDriver()); LoginHelper.EnterUserName(userName); LoginHelper.EnterPassword(password); LoginHelper.ClickEnterButton(); }
protected void OnBtnLoginClicked(object sender, EventArgs e) { if (string.IsNullOrEmpty (txtUserName.Text) || string.IsNullOrEmpty (txtPassword.Text)) return; if (string.IsNullOrEmpty (combSites.ActiveText)) return; LoginHelper loginHelper = new LoginHelper (); txtResult.Buffer.Text = JsonConvert.SerializeObject (loginHelper.Login (txtUserName.Text, txtPassword.Text, Enums.GetEnumName<LoginSite> (combSites.ActiveText)).Cookies); }
protected void Pay_Click(object sender, EventArgs e) { var records = (InvoiceDetails[])Session["records"]; var recordsForSend = new Collection<InvoiceDetails>(); foreach (var item in records) { if (item.chkValue && item.Invoice_Unbilled_Amount > 0) { var idet = new InvoiceDetails(); idet.Invoice_Unbilled_Amount = item.Invoice_Unbilled_Amount; idet.Invoice_Ref_Number = item.Invoice_Ref_Number; recordsForSend.Add(idet); } } try { if (recordsForSend.Count > 0) { var p = new Pay(); LoginHelper loginHelper = new LoginHelper(); info = loginHelper.GetLoginInfoPage(Page); var customer = loginHelper.GetProfile(info); customer.eMail = txtEmail.Text; if (customer.eMail != string.Empty) { //ToDo Da se sredi //Provider.ProfileUpdate(info, customer); } p.PayInvoicesCaSyS(recordsForSend, info, "MK", txtEmail.Text); } } catch (ThreadAbortException) { } catch (Exception ex) { //Utils.LogError(ex); } }
/// <summary> /// Main constructor /// </summary> /// <param name="p">the client's process object</param> public Client(Process p) { process = p; process.Exited += new EventHandler(process_Exited); process.EnableRaisingEvents = true; // Wait until we can really access the process process.WaitForInputIdle(); while (process.MainWindowHandle == IntPtr.Zero) { process.Refresh(); System.Threading.Thread.Sleep(5); } // Save a copy of the handle so the process doesn't have to be opened // every read/write operation processHandle = Util.WinApi.OpenProcess(Util.WinApi.PROCESS_ALL_ACCESS, 0, (uint)process.Id); pathFinder = new Tibia.Util.AStarPathFinder(this); contextMenu = new ContextMenu(this); memory = new MemoryHelper(this); window = new WindowHelper(this); io = new IOHelper(this); login = new LoginHelper(this); dll = new DllHelper(this); input = new InputHelper(this); player = new PlayerHelper(this); icon = new Icon(this); skin = new Skin(this); // Save the start time (it isn't changing) startTime = Memory.ReadInt32(Addresses.Client.StartTime); }
/// <summary> /// Main constructor /// </summary> /// <param name="p">the client's process object</param> public Client(Process p) { process = p; process.Exited += new EventHandler(process_Exited); process.EnableRaisingEvents = true; // Wait until we can really access the process process.WaitForInputIdle(); while (process.MainWindowHandle == IntPtr.Zero) { process.Refresh(); System.Threading.Thread.Sleep(5); } // Save a copy of the handle so the process doesn't have to be opened // every read/write operation processHandle = Util.WinApi.OpenProcess(Util.WinApi.PROCESS_ALL_ACCESS, 0, (uint)process.Id); memory = new MemoryHelper(this); window = new WindowHelper(this); login = new LoginHelper(this); input = new InputHelper(this); }
public void logout() { LoginHelper loginHelper = new LoginHelper(GetWebDriver()); loginHelper.ClickElement("Logout"); loginHelper.WaitForTextVisible("Map", 30); }
public LoginViewModel() { helper = new LoginHelper(); }
public void createEquipments() { string[] username = null; string[] password = null; XMLParse oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); username = oXMLData.getData("settings/Credentials", "username"); password = oXMLData.getData("settings/Credentials", "password"); //Initializing the objects LoginHelper loginHelper = new LoginHelper(GetWebDriver()); ClientsHelper clientHelper = new ClientsHelper(GetWebDriver()); CreateEquipmentAdminHelper createEquipmentAdminHelper = new CreateEquipmentAdminHelper(GetWebDriver()); //Variable String name = "Test" + RandomNumber(1, 99); String Id = "12345" + RandomNumber(1, 99); //Login with valid username and password Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); //Verify Page title VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); //Click On Admin createEquipmentAdminHelper.RedirectToAdmin(); //################## Redirect To Url //Redirect To URL createEquipmentAdminHelper.RedirectToPage(); //Verify title VerifyTitle("Equipment"); //################################# Create Equipments ############################################# // Click On Create createEquipmentAdminHelper.ClickElement("ClickOnCreate"); //Verify title VerifyTitle("Equipment Create"); //Enter Equipment Name createEquipmentAdminHelper.TypeText("EqpName", name); //Enter DownloadsIDName createEquipmentAdminHelper.Select("Type", "Check Reader"); //Enter Equipment Id createEquipmentAdminHelper.TypeText("EquipmentId", Id); //Enter Version createEquipmentAdminHelper.TypeText("Version", "Testing"); //Enter Description createEquipmentAdminHelper.TypeText("Description", "This is Testing Description"); //Click On First CheckBox createEquipmentAdminHelper.ClickElement("ClickOnFirstCheckBox"); //Click On First CheckBox createEquipmentAdminHelper.ClickElement("ClickOn2CheckBox"); //######################## CLICK ON SAVE BUTTON ######################################## // Click on Save button createEquipmentAdminHelper.ClickElement("SaveBtn"); createEquipmentAdminHelper.WaitForText("Equipment saved successfully", 30); }
public void ticketsAdvanceFilterRelatedTo() { 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 officeTickets_AllTicketsHelper = new OfficeTickets_AllTicketsHelper(GetWebDriver()); // Variable String JIRA = ""; String Status = "Pass"; try { executionLog.Log("TicketsAdvanceFilterRelatedTo", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("TicketsAdvanceFilterRelatedTo", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); // Verify tickets with notes. executionLog.Log("TicketsAdvanceFilterRelatedTo", "Redirect To URL"); VisitOffice("tickets"); officeTickets_AllTicketsHelper.WaitForWorkAround(3000); executionLog.Log("TicketsAdvanceFilterRelatedTo", "Verify page title."); VerifyTitle("Tickets"); //officeTickets_AllTicketsHelper.WaitForElementVisible("AdvanceFilter", 10); executionLog.Log("TicketsAdvanceFilterRelatedTo", "Click on advance filter."); officeTickets_AllTicketsHelper.ClickElement("AdvanceFilter"); officeTickets_AllTicketsHelper.WaitForWorkAround(2000); executionLog.Log("TicketsAdvanceFilterRelatedTo", "click ticket with activity type."); officeTickets_AllTicketsHelper.ClickForce("TicketswithNotes"); //officeTickets_AllTicketsHelper.WaitForWorkAround(3000); executionLog.Log("TicketsAdvanceFilterRelatedTo", "Click on apply button."); officeTickets_AllTicketsHelper.ClickForce("Apply"); officeTickets_AllTicketsHelper.WaitForWorkAround(3000); officeTickets_AllTicketsHelper.ClickElement("ClickTicket1"); officeTickets_AllTicketsHelper.WaitForWorkAround(3000); executionLog.Log("TicketsAdvanceFilterRelatedTo", "Select activity type as notes."); officeTickets_AllTicketsHelper.SelectByText("SelectActivity", "Notes"); officeTickets_AllTicketsHelper.WaitForWorkAround(3000); executionLog.Log("TicketsAdvanceFilterRelatedTo", "Verify note present for ticket."); officeTickets_AllTicketsHelper.VerifyText("NoteTicket", "Notes"); //officeTickets_AllTicketsHelper.WaitForWorkAround(3000); //Verify tickets with documents. executionLog.Log("TicketsAdvanceFilterRelatedTo", "Redirect To URL"); VisitOffice("tickets"); officeTickets_AllTicketsHelper.WaitForWorkAround(3000); executionLog.Log("TicketsAdvanceFilterRelatedTo", "Verify page title."); VerifyTitle("Tickets"); //officeTickets_AllTicketsHelper.WaitForElementVisible("AdvanceFilter", 10); executionLog.Log("TicketsAdvanceFilterRelatedTo", "Click on advance filter."); officeTickets_AllTicketsHelper.ClickElement("AdvanceFilter"); officeTickets_AllTicketsHelper.WaitForWorkAround(2000); executionLog.Log("TicketsAdvanceFilterRelatedTo", "click ticket with activity type."); officeTickets_AllTicketsHelper.ClickForce("TicketWithDocs"); //officeTickets_AllTicketsHelper.WaitForWorkAround(3000); executionLog.Log("TicketsAdvanceFilterRelatedTo", "Click on apply button."); officeTickets_AllTicketsHelper.ClickForce("Apply"); officeTickets_AllTicketsHelper.WaitForWorkAround(3000); officeTickets_AllTicketsHelper.ClickElement("ClickTicket1"); officeTickets_AllTicketsHelper.WaitForWorkAround(3000); executionLog.Log("TicketsAdvanceFilterRelatedTo", "Select activity type as documents ."); officeTickets_AllTicketsHelper.SelectByText("SelectActivity", "Documents"); officeTickets_AllTicketsHelper.WaitForWorkAround(3000); executionLog.Log("TicketsAdvanceFilterRelatedTo", "Verify ticket present has document."); officeTickets_AllTicketsHelper.VerifyText("NoteTicket", "Documents"); //officeTickets_AllTicketsHelper.WaitForWorkAround(3000); //Verify ticket with meetings. executionLog.Log("TicketsAdvanceFilterRelatedTo", "Redirect To URL"); VisitOffice("tickets"); officeTickets_AllTicketsHelper.WaitForWorkAround(3000); executionLog.Log("TicketsAdvanceFilterRelatedTo", "Verify page title."); VerifyTitle("Tickets"); //officeTickets_AllTicketsHelper.WaitForElementVisible("AdvanceFilter", 10); executionLog.Log("TicketsAdvanceFilterRelatedTo", "Click on advance filter."); officeTickets_AllTicketsHelper.ClickElement("AdvanceFilter"); officeTickets_AllTicketsHelper.WaitForWorkAround(2000); executionLog.Log("TicketsAdvanceFilterRelatedTo", "Click ticket with activity type."); officeTickets_AllTicketsHelper.ClickForce("TicketsWithMeetings"); //officeTickets_AllTicketsHelper.WaitForWorkAround(3000); executionLog.Log("TicketsAdvanceFilterRelatedTo", "Click on apply button."); officeTickets_AllTicketsHelper.ClickForce("Apply"); officeTickets_AllTicketsHelper.WaitForWorkAround(3000); officeTickets_AllTicketsHelper.ClickElement("ClickTicket1"); officeTickets_AllTicketsHelper.WaitForWorkAround(3000); executionLog.Log("TicketsAdvanceFilterRelatedTo", "Select activity type as meetings"); officeTickets_AllTicketsHelper.SelectByText("SelectActivity", "Meetings"); officeTickets_AllTicketsHelper.WaitForWorkAround(3000); executionLog.Log("TicketsAdvanceFilterRelatedTo", "Verify meeting present for ticket."); officeTickets_AllTicketsHelper.VerifyText("NoteTicket", "Meeting"); //officeTickets_AllTicketsHelper.WaitForWorkAround(3000); // Verify ticket with tasks . executionLog.Log("TicketsAdvanceFilterRelatedTo", "Redirect To URL"); VisitOffice("tickets"); officeTickets_AllTicketsHelper.WaitForWorkAround(3000); executionLog.Log("TicketsAdvanceFilterRelatedTo", "Verify page title."); VerifyTitle("Tickets"); //officeTickets_AllTicketsHelper.WaitForElementVisible("AdvanceFilter", 10); executionLog.Log("TicketsAdvanceFilterRelatedTo", "Click on advance filter."); officeTickets_AllTicketsHelper.ClickElement("AdvanceFilter"); officeTickets_AllTicketsHelper.WaitForWorkAround(2000); executionLog.Log("TicketsAdvanceFilterRelatedTo", "click ticket with activity type."); officeTickets_AllTicketsHelper.ClickForce("TicketWithTasks"); officeTickets_AllTicketsHelper.WaitForWorkAround(3000); executionLog.Log("TicketsAdvanceFilterRelatedTo", "Click on apply button."); officeTickets_AllTicketsHelper.ClickForce("Apply"); officeTickets_AllTicketsHelper.WaitForWorkAround(3000); officeTickets_AllTicketsHelper.ClickElement("ClickTicket1"); officeTickets_AllTicketsHelper.WaitForWorkAround(3000); executionLog.Log("TicketsAdvanceFilterRelatedTo", "Select activity type as tasks."); officeTickets_AllTicketsHelper.SelectByText("SelectActivity", "Tasks"); officeTickets_AllTicketsHelper.WaitForWorkAround(3000); executionLog.Log("TicketsAdvanceFilterRelatedTo", "Verify task present for the ticket."); officeTickets_AllTicketsHelper.VerifyText("NoteTicket", "Task"); //officeTickets_AllTicketsHelper.WaitForWorkAround(3000); // Verify ticket with calls . executionLog.Log("TicketsAdvanceFilterRelatedTo", "Redirect To URL"); VisitOffice("tickets"); officeTickets_AllTicketsHelper.WaitForWorkAround(3000); executionLog.Log("TicketsAdvanceFilterRelatedTo", "Verify page title."); VerifyTitle("Tickets"); //officeTickets_AllTicketsHelper.WaitForElementVisible("AdvanceFilter", 10); executionLog.Log("TicketsAdvanceFilterRelatedTo", "Click on advance filter."); officeTickets_AllTicketsHelper.ClickElement("AdvanceFilter"); officeTickets_AllTicketsHelper.WaitForWorkAround(2000); executionLog.Log("TicketsAdvanceFilterRelatedTo", "click ticket with activity type."); officeTickets_AllTicketsHelper.ClickForce("TicketWithCalls"); //officeTickets_AllTicketsHelper.WaitForWorkAround(3000); executionLog.Log("TicketsAdvanceFilterRelatedTo", "Click on apply button."); officeTickets_AllTicketsHelper.ClickForce("Apply"); officeTickets_AllTicketsHelper.WaitForWorkAround(3000); officeTickets_AllTicketsHelper.ClickElement("ClickTicket1"); officeTickets_AllTicketsHelper.WaitForWorkAround(3000); executionLog.Log("TicketsAdvanceFilterRelatedTo", "Select activity type as calls."); officeTickets_AllTicketsHelper.SelectByText("SelectActivity", "Calls"); officeTickets_AllTicketsHelper.WaitForWorkAround(3000); executionLog.Log("TicketsAdvanceFilterRelatedTo", "Verify calls present for ticket."); officeTickets_AllTicketsHelper.VerifyText("NoteTicket", "Calls"); //officeTickets_AllTicketsHelper.WaitForWorkAround(3000); // Verify tickets with attachments . executionLog.Log("TicketsAdvanceFilterRelatedTo", "Redirect To URL"); VisitOffice("tickets"); officeTickets_AllTicketsHelper.WaitForWorkAround(3000); executionLog.Log("TicketsAdvanceFilterRelatedTo", "Verify page title."); VerifyTitle("Tickets"); //officeTickets_AllTicketsHelper.WaitForElementVisible("AdvanceFilter", 10); executionLog.Log("TicketsAdvanceFilterRelatedTo", "Click on advance filter."); officeTickets_AllTicketsHelper.ClickElement("AdvanceFilter"); officeTickets_AllTicketsHelper.WaitForWorkAround(2000); executionLog.Log("TicketsAdvanceFilterRelatedTo", "click ticket with activity type."); officeTickets_AllTicketsHelper.ClickForce("TicketWithCalls"); //officeTickets_AllTicketsHelper.WaitForWorkAround(3000); executionLog.Log("TicketsAdvanceFilterRelatedTo", "Click on apply button."); officeTickets_AllTicketsHelper.ClickForce("Apply"); officeTickets_AllTicketsHelper.WaitForWorkAround(3000); officeTickets_AllTicketsHelper.ClickElement("ClickTicket1"); officeTickets_AllTicketsHelper.WaitForWorkAround(3000); executionLog.Log("TicketsAdvanceFilterRelatedTo", "Verify document present is related to clients"); officeTickets_AllTicketsHelper.SelectByText("SelectActivity", "Calls"); officeTickets_AllTicketsHelper.WaitForWorkAround(3000); executionLog.Log("TicketsAdvanceFilterRelatedTo", "Verify document present is related to clients"); officeTickets_AllTicketsHelper.VerifyText("NoteTicket", "Calls"); //officeTickets_AllTicketsHelper.WaitForWorkAround(3000); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("TicketsAdvanceFilterRelatedTo"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("TicketsAdvanceFilterRelatedTo"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("TicketsAdvanceFilterRelatedTo", "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("TicketsAdvanceFilterRelatedTo"); TakeScreenshot("TicketsAdvanceFilterRelatedTo"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\TicketsAdvanceFilterRelatedTo.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("TicketsAdvanceFilterRelatedTo"); string id = loginHelper.getIssueID("TicketsAdvanceFilterRelatedTo"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\TicketsAdvanceFilterRelatedTo.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("TicketsAdvanceFilterRelatedTo"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("TicketsAdvanceFilterRelatedTo"); executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("TicketsAdvanceFilterRelatedTo"); executionLog.WriteInExcel("TicketsAdvanceFilterRelatedTo", Status, JIRA, "Opportunities Management"); } }
public void merchantTabCorp() { string[] username = null; string[] password = null; var oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); username = oXMLData.getData("settings/Credentials", "username_corp"); password = oXMLData.getData("settings/Credentials", "password"); // Initializing the objects var executionLog = new ExecutionLog(); var loginHelper = new LoginHelper(GetWebDriver()); var corp_MerchantHelper = new Corp_MerchantHelper(GetWebDriver()); // VARIABLE String Status = "Pass"; String JIRA = ""; try { executionLog.Log("MerchantTabCorp", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("MerchantTabCorp", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("MerchantTabCorp", "Click on merchant tab"); corp_MerchantHelper.ClickElement("ClickOnMerchnatTab"); executionLog.Log("MerchantTabCorp", "verify marchants available"); corp_MerchantHelper.VerifyPageText("Merchants"); corp_MerchantHelper.WaitForWorkAround(3000); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("MerchantTabCorp"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Merchant Tab Corp"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Merchant Tab Corp", "Bug", "Medium", "Corp Merchants page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Merchant Tab Corp"); TakeScreenshot("MerchantTabCorp"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\MerchantTabCorp.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("MerchantTabCorp"); string id = loginHelper.getIssueID("Merchant Tab Corp"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\MerchantTabCorp.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Merchant Tab Corp"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Merchant Tab Corp"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("MerchantTabCorp"); executionLog.WriteInExcel("Merchant Tab Corp", Status, JIRA, "Corp Merchant"); } }
void connectCallback(IAsyncResult asyncConnect) { if(clientSocket.Connected==true) { Debug.Log("connectSuccess"); Debug.Log("Send Login info....."); LoginHelper loginHelper = new LoginHelper("user@service", "1000129", "user", ipaddress, port); LoginInOutCodecs loginCodecs = new LoginInOutCodecs(); byte[] loginBytes = loginCodecs.getOutCodecs().transform(loginHelper.getLoginEvent()) as byte[]; clientSocket.Send(loginBytes); } }
public void importLeadCancel() { 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_LeadsHelper = new Office_LeadsHelper(GetWebDriver()); // Random Variables var File = GetPathToFile() + "leadsamples.csv"; String JIRA = ""; String Status = "Pass"; try { executionLog.Log("ImportLeadCancel", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("ImportLeadCancel", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("ImportLeadCancel", "Redirect at import leads page."); VisitOffice("leads/import"); executionLog.Log("ImportLeadCancel", "Upload a file with duplicate records"); office_LeadsHelper.UploadFile("//*[@id='vcard_file']", File); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("ImportLeadCancel", "Click on import button"); office_LeadsHelper.ClickElement("LeadImport"); office_LeadsHelper.WaitForWorkAround(1000); executionLog.Log("ImportLeadCancel", "Scroll to merge button"); office_LeadsHelper.ScrollDown("//div[@class='row']/div/a[@title='Merge']"); executionLog.Log("ImportLeadCancel", "Click on merge button"); office_LeadsHelper.ClickElement("MergeDuplicate"); office_LeadsHelper.WaitForWorkAround(1000); executionLog.Log("ImportLeadCancel", "Decline the alert message by click cancel."); office_LeadsHelper.DeclineAlert(); executionLog.Log("ImportLeadCancel", "Again click on merge button."); office_LeadsHelper.ClickElement("MergeDuplicate"); office_LeadsHelper.WaitForWorkAround(2000); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("ImportLeadCancel"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Import Lead Cancel"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Import Lead Cancel", "Bug", "Medium", "Leads page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Import Lead Cancel"); TakeScreenshot("ImportLeadCancel"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\ImportLeadCancel.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("ImportLeadCancel"); string id = loginHelper.getIssueID("Import Lead Cancel"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\ImportLeadCancel.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Import Lead Cancel"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Import Lead Cancel"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("ImportLeadCancel"); executionLog.WriteInExcel("Import Lead Cancel", Status, JIRA, "Leads Management"); } }
public void documentsAdvanceFilterResultsPP() { string[] username = null; string[] password = null; var oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); username = oXMLData.getData("settings/Credentials", "username_office"); password = oXMLData.getData("settings/Credentials", "password"); // Initializing the objects var executionLog = new ExecutionLog(); var loginHelper = new LoginHelper(GetWebDriver()); var officeActivities_DocumentHelper = new OfficeActivities_DocumentHelper(GetWebDriver()); // Variable var DocName = "Test Exe" + GetRandomNumber(); var fileUpl = GetPathToFile() + "chrome.exe"; String JIRA = ""; String Status = "Pass"; try { executionLog.Log("DocumentsAdvanceFilterResultsPP", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("DocumentsAdvanceFilterResultsPP", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("DocumentsAdvanceFilterResultsPP", "Redirect at employee page."); VisitOffice("documents"); officeActivities_DocumentHelper.WaitForWorkAround(3000); executionLog.Log("DocumentsAdvanceFilterResultsPP", "Verify page title."); VerifyTitle("Documents"); //officeActivities_DocumentHelper.WaitForElementVisible("AdvanceFilter", 20); executionLog.Log("DocumentsAdvanceFilterResultsPP", "Click on advance filter."); officeActivities_DocumentHelper.ClickElement("AdvanceFilter"); officeActivities_DocumentHelper.WaitForWorkAround(2000); executionLog.Log("DocumentsAdvanceFilterResultsPP", "Select number of records to 10."); officeActivities_DocumentHelper.SelectByText("ResultsPerPage", "10"); //officeActivities_DocumentHelper.WaitForWorkAround(3000); executionLog.Log("DocumentsAdvanceFilterResultsPP", "Click on Apply button."); officeActivities_DocumentHelper.ClickElement("Apply"); officeActivities_DocumentHelper.WaitForWorkAround(3000); executionLog.Log("DocumentsAdvanceFilterResultsPP", "Verify number of records displayed."); officeActivities_DocumentHelper.ShowResult(30); //officeActivities_DocumentHelper.WaitForWorkAround(3000); executionLog.Log("DocumentsAdvanceFilterResultsPP", "Click on advance filter."); officeActivities_DocumentHelper.ClickElement("AdvanceFilter"); officeActivities_DocumentHelper.WaitForWorkAround(2000); executionLog.Log("DocumentsAdvanceFilterResultsPP", "Select number of records to 20."); officeActivities_DocumentHelper.SelectByText("ResultsPerPage", "20"); //officeActivities_DocumentHelper.WaitForWorkAround(4000); executionLog.Log("DocumentsAdvanceFilterResultsPP", "Click on Apply button."); officeActivities_DocumentHelper.ClickElement("Apply"); officeActivities_DocumentHelper.WaitForWorkAround(3000); executionLog.Log("DocumentsAdvanceFilterResultsPP", "Verify number of records displayed."); officeActivities_DocumentHelper.ShowResult(50); //officeActivities_DocumentHelper.WaitForWorkAround(4000); executionLog.Log("DocumentsAdvanceFilterResultsPP", "Click on advance filter."); officeActivities_DocumentHelper.ClickElement("AdvanceFilter"); officeActivities_DocumentHelper.WaitForWorkAround(2000); executionLog.Log("DocumentsAdvanceFilterResultsPP", "Select number of records to 50."); officeActivities_DocumentHelper.SelectByText("ResultsPerPage", "50"); //officeActivities_DocumentHelper.WaitForWorkAround(4000); executionLog.Log("DocumentsAdvanceFilterResultsPP", "Click on Apply button."); officeActivities_DocumentHelper.ClickElement("Apply"); officeActivities_DocumentHelper.WaitForWorkAround(3000); executionLog.Log("DocumentsAdvanceFilterResultsPP", "Verify number of records displayed."); officeActivities_DocumentHelper.ShowResult(40); //officeActivities_DocumentHelper.WaitForWorkAround(4000); executionLog.Log("DocumentsAdvanceFilterResultsPP", "Click on advance filter."); officeActivities_DocumentHelper.ClickElement("AdvanceFilter"); officeActivities_DocumentHelper.WaitForWorkAround(2000); executionLog.Log("DocumentsAdvanceFilterResultsPP", "Select number of records to 100."); officeActivities_DocumentHelper.SelectByText("ResultsPerPage", "100"); //officeActivities_DocumentHelper.WaitForWorkAround(4000); executionLog.Log("DocumentsAdvanceFilterResultsPP", "Click on Apply button."); officeActivities_DocumentHelper.ClickElement("Apply"); officeActivities_DocumentHelper.WaitForWorkAround(3000); executionLog.Log("DocumentsAdvanceFilterResultsPP", "Verify number of records displayed."); officeActivities_DocumentHelper.ShowResult(100); //officeActivities_DocumentHelper.WaitForWorkAround(4000); executionLog.Log("DocumentsAdvanceFilterResultsPP", "Logout from the application."); VisitOffice("logout"); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("DocumentsAdvanceFilterResultsPP"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Documents Advance Filter ResultsPP"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Documents Advance Filter ResultsPP", "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("Documents Advance Filter ResultsPP"); TakeScreenshot("DocumentsAdvanceFilterResultsPP"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\DocumentsAdvanceFilterResultsPP.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("DocumentsAdvanceFilterResultsPP"); string id = loginHelper.getIssueID("Documents Advance Filter ResultsPP"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\DocumentsAdvanceFilterResultsPP.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Documents Advance Filter ResultsPP"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Documents Advance Filter ResultsPP"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("DocumentsAdvanceFilterResultsPP"); executionLog.WriteInExcel("Documents Advance Filter ResultsPP", Status, JIRA, "Opportunities Management"); } }
public void exportError() { 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 residualIncome_OfficePayout_DetailedPayoutHelper = new ResidualIncome_OfficePayout_DetailedPayoutHelper(GetWebDriver()); String Status = "Pass"; String JIRA = ""; try { executionLog.Log("ExportError", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("ExportError", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("ExportError", "Navigate to the detailed payout page."); VisitOffice("rir/detailed_payouts"); executionLog.Log("ExportError", "verify title"); VerifyTitle("Residual Income - Payouts"); executionLog.Log("ExportError", "Click on Advance filter"); residualIncome_OfficePayout_DetailedPayoutHelper.ClickElement("Advance"); executionLog.Log("ExportError", "Click on Apply buton"); residualIncome_OfficePayout_DetailedPayoutHelper.ClickElement("Apply"); executionLog.Log("ExportError", "Click on Export buton"); residualIncome_OfficePayout_DetailedPayoutHelper.ClickElement("Exp"); executionLog.Log("ExportError", "Click on Export as csv link"); residualIncome_OfficePayout_DetailedPayoutHelper.ClickElement("ExpCSV"); executionLog.Log("ExportError", "Click on Advance filter"); residualIncome_OfficePayout_DetailedPayoutHelper.ClickElement("Advance"); Console.WriteLine("Done"); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("ExportError"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Export Error"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Export Error", "Bug", "Medium", "Residual Income page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Export Error"); TakeScreenshot("ExportError"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\ExportError.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("ExportError"); string id = loginHelper.getIssueID("Export Error"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\ExportError.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Export Error"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Export Error"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("ExportError"); executionLog.WriteInExcel("Export Error", Status, JIRA, "Residual Adjustment"); } }
public void verifyMappingOfClone_of_CoCardEnhancedBillback2105_ia_Final_co_br() { 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 pDFTemplate_PDFTemplateHelper = new PDFTemplate_PDFTemplateHelper(GetWebDriver()); var office_ClientsHelper = new Office_ClientsHelper(GetWebDriver()); var pdffilesHelper = new PDFfilesHelper(GetWebDriver()); // Variable var name = "Test" + GetRandomNumber(); var name2 = "Testlist" + GetRandomNumber(); var Id = "12345" + GetRandomNumber(); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("VerifyMappingOfClone_of_CoCardEnhancedBillback2105_ia_Final_co_br", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("VerifyMappingOfClone_of_CoCardEnhancedBillback2105_ia_Final_co_br", "Go to PDF templates page"); VisitOffice("pdf_templates"); pDFTemplate_PDFTemplateHelper.WaitForWorkAround(2000); executionLog.Log("VerifyMappingOfClone_of_CoCardEnhancedBillback2105_ia_Final_co_br", "Search for required pdf"); pDFTemplate_PDFTemplateHelper.TypeText("EnterPDFToSearch", "Clone of CoCardEnhancedBillback2105_ia_Final co-br"); pDFTemplate_PDFTemplateHelper.WaitForWorkAround(2000); executionLog.Log("VerifyMappingOfClone_of_CoCardEnhancedBillback2105_ia_Final_co_br", "Click on PDF Halo Edit"); pDFTemplate_PDFTemplateHelper.ClickElement("PDFHaloEdit"); pDFTemplate_PDFTemplateHelper.WaitForWorkAround(2000); pDFTemplate_PDFTemplateHelper.ClickElement("SelectVisualMap"); pDFTemplate_PDFTemplateHelper.ClickElement("SubmitMapOptn"); pDFTemplate_PDFTemplateHelper.WaitForElementPresent("//input[@name='visaPartialAuth']", 20); executionLog.Log("VerifyMappingOfClone_of_CoCardEnhancedBillback2105_ia_Final_co_br", "Check mapping"); pdffilesHelper.ClickElement("VisaCredit_DiscRate"); pdffilesHelper.WaitForWorkAround(3000); string tab1 = pdffilesHelper.getInputText("//*[@id='directmapdiv']/div[2]/div[1]/div[1]/div/button"); string section1 = pdffilesHelper.getInputText("//*[@id='directmapdiv']/div[2]/div[1]/div[2]/div/button"); string field1 = pdffilesHelper.getInputText("//*[@id='directmapdiv']/div[2]/div[1]/div[4]/div/button"); GetWebDriver().Navigate().GoToUrl("https://www.mypegasuscrm.com/newthemecorp/pegasustestoffice/clients/view/200866"); pdffilesHelper.WaitForWorkAround(2000); if (tab1 == "Rates & Fees") { office_ClientsHelper.ClickElement("RatesAndFee"); } else { } //Boolean test = Assert.IsTrue(pDFTemplate_PDFTemplateHelper.IsElementPresent("//*[@id='ClientRatesFeeAmexRate']")); if (office_ClientsHelper.IsElementPresent("//*[@id='ClientRatesFeeAmexRate']") == true) { office_ClientsHelper.TypeText("Amexp", "61"); office_ClientsHelper.ClickElement("RandFSave"); office_ClientsHelper.WaitForWorkAround(2000); } else { } GetWebDriver().Navigate().GoToUrl("https://www.mypegasuscrm.com/newthemecorp/pegasustestoffice/clients/pdfs/200866/html/602450"); office_ClientsHelper.WaitForWorkAround(4000); string value = pDFTemplate_PDFTemplateHelper.getInputText("//*[@id='qualRate']"); Assert.AreEqual("61", value); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("CustomColumnsLead"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Custom Columns Lead"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Custom Columns Lead", "Bug", "Medium", "Equipment page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Custom Columns Lead"); TakeScreenshot("CustomColumnsLead"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\CustomColumnsLead.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("CustomColumnsLead"); string id = loginHelper.getIssueID("Custom Columns Lead"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\CustomColumnsLead.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Custom Columns Lead"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Custom Columns Lead"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("CustomColumnsLead"); executionLog.WriteInExcel("Custom Columns Lead", Status, JIRA, "List Management"); } }
public void verifyPartnerAssociationAdvanceFilterColumnOrder() { 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 agents_PartnerAssociationHelper = new Agents_PartnerAssociationHelper(GetWebDriver()); // Variable Random String JIRA = ""; String Status = "Pass"; try { executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Verify Page title as dash board"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Redirect To partner association page."); VisitOffice("partners/associations"); agents_PartnerAssociationHelper.WaitForWorkAround(5000); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Verify page title as partner association"); VerifyTitle("Partner Associations"); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Verify status column is visible on the page."); agents_PartnerAssociationHelper.IsElementPresent("HeadStatus"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Verify E-Mail column is visible on the page."); agents_PartnerAssociationHelper.IsElementPresent("HeadEmail"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Verify Phone column is visible on the page."); agents_PartnerAssociationHelper.IsElementPresent("HeadPhone"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Verify Modified column is visible on the page."); agents_PartnerAssociationHelper.IsElementPresent("HeadModified"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Click on advance filter button."); agents_PartnerAssociationHelper.ClickElement("AdvanceFilter"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Select status in displayed columns."); agents_PartnerAssociationHelper.SelectByText("DisplayedCols", "Status"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Click arrow to move column to avail cols."); agents_PartnerAssociationHelper.ClickElement("RemoveCols"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Select E-Mail in displayed columns."); agents_PartnerAssociationHelper.SelectByText("DisplayedCols", "E-Mail"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Click arrow to move column to avail cols"); agents_PartnerAssociationHelper.ClickElement("RemoveCols"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Select Phone in displayed columns."); agents_PartnerAssociationHelper.SelectByText("DisplayedCols", "Phone"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Click arrow to move column to avail cols"); agents_PartnerAssociationHelper.ClickElement("RemoveCols"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Select Modified in displayed columns."); agents_PartnerAssociationHelper.SelectByText("DisplayedCols", "Modified"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Click arrow to move column to avail cols"); agents_PartnerAssociationHelper.ClickElement("RemoveCols"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Click on Apply button."); agents_PartnerAssociationHelper.ClickElement("ApplyButton"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Verify status column not present on page."); agents_PartnerAssociationHelper.IsElementNotPresent("HeadStatus"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Verify E-Mail column not present on page."); agents_PartnerAssociationHelper.IsElementNotPresent("HeadEmail"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Verify Phone column not present on page."); agents_PartnerAssociationHelper.IsElementNotPresent("HeadPhone"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Verify Modified column not present on page."); agents_PartnerAssociationHelper.IsElementNotPresent("HeadModified"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Redirect at leads page."); VisitOffice("leads"); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Verify page title as leads."); VerifyTitle("Leads"); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Redirect at partner associations page."); VisitOffice("partners/associations"); agents_PartnerAssociationHelper.WaitForWorkAround(5000); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Verify page title as partner association."); VerifyTitle("Partner Associations"); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Verify default position of E-Mail column."); agents_PartnerAssociationHelper.IsElementPresent("HeadEmail5"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Verify default position of Phone column."); agents_PartnerAssociationHelper.IsElementPresent("HeadPhone6"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Redirect at partner associations page."); VisitOffice("partners/associations"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Click on advance filter button."); agents_PartnerAssociationHelper.ClickElement("AdvanceFilter"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Select E-Mail in displayed column."); agents_PartnerAssociationHelper.SelectByText("DisplayedCols", "E-Mail"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Move email 1 step up."); agents_PartnerAssociationHelper.ClickElement("MoveUp"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Move email 1 step up."); agents_PartnerAssociationHelper.ClickElement("MoveUp"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Move email 1 step up."); agents_PartnerAssociationHelper.ClickElement("MoveUp"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Select Phone in displayed column."); agents_PartnerAssociationHelper.SelectByText("DisplayedCols", "Phone"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Move phone 1 step down."); agents_PartnerAssociationHelper.ClickElement("MoveDown"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Click on Apply button."); agents_PartnerAssociationHelper.ClickElement("ApplyButton"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Verify changed position of E-Mail column."); agents_PartnerAssociationHelper.IsElementPresent("HeadEmail3"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Verify changed position of Phone column."); agents_PartnerAssociationHelper.IsElementPresent("HeadPhone7"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Logout from the application."); VisitOffice("logout"); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("VerifyPartnerAssociationAdvanceFilterColumnOrder"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Verify Partner Association Advance Filter Column Order"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Verify Partner Association Advance Filter Column Order", "Bug", "Medium", "Activities page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Verify Partner Association Advance Filter Column Order"); TakeScreenshot("VerifyPartnerAssociationAdvanceFilterColumnOrder"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyPartnerAssociationAdvanceFilterColumnOrder.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("VerifyPartnerAssociationAdvanceFilterColumnOrder"); string id = loginHelper.getIssueID("Verify Partner Association Advance Filter Column Order"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyPartnerAssociationAdvanceFilterColumnOrder.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Verify Partner Association Advance Filter Column Order"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Verify Partner Association Advance Filter Column Order"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("VerifyPartnerAssociationAdvanceFilterColumnOrder"); executionLog.WriteInExcel("Verify Partner Association Advance Filter Column Order", Status, JIRA, "Meetings Management"); } }
public void editCorpEmployee() { string[] username = null; string[] password = null; var oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); username = oXMLData.getData("settings/Credentials", "username2"); password = oXMLData.getData("settings/Credentials", "password2"); //Initializing the objects var loginHelper = new LoginHelper(GetWebDriver()); var clientHelper = new ClientsHelper(GetWebDriver()); var corpEmployeeHelper = new CorpEmployeeHelper(GetWebDriver()); //Login with valid username and password Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); //Verify Page title VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); //Click on Agent in Topmenu corpEmployeeHelper.ClickElement("ClickOnEmployeeTab"); corpEmployeeHelper.WaitForWorkAround(4000); //Search Employee corpEmployeeHelper.TypeText("SearchEmployee", "Test Tester"); var Loc = "//table[@id='list1']/tbody/tr[2]"; if (corpEmployeeHelper.IsElementPresent(Loc)) { //Click on Edit corpEmployeeHelper.ClickElement("ClickOnEdit"); corpEmployeeHelper.WaitForWorkAround(3000); //Enter zip code corpEmployeeHelper.TypeText("EnterZipCode", "60601"); corpEmployeeHelper.WaitForWorkAround(3000); //Enter First Name corpEmployeeHelper.TypeText("EnterFirstName", "Test"); //Enter Last Name corpEmployeeHelper.TypeText("EnterLastName", "Tester"); //Click On Save corpEmployeeHelper.ClickElement("ClickOnSave"); corpEmployeeHelper.WaitForWorkAround(4000); //Verify corpEmployeeHelper.VerifyPageText("Employee Details successfully updated"); corpEmployeeHelper.WaitForWorkAround(4000); } else { //ClickOnCreate corpEmployeeHelper.ClickElement("ClickOnCreate"); //Enter User Name var usernme = "DemoUser" + RandomNumber(1, 999); corpEmployeeHelper.TypeText("EnterUserName", usernme); //Click On Save corpEmployeeHelper.ClickElement("ClickOnSave"); corpEmployeeHelper.WaitForWorkAround(4000); //Verify This field is required. corpEmployeeHelper.VerifyPageText("This field is required."); //Verifytext corpEmployeeHelper.VerifyPageText("This field is required."); //verify corpEmployeeHelper.VerifyText("VerifyvALIDATION", "This field is required."); //Enter Phone Number corpEmployeeHelper.VerifyText("VerifyAvatar", "This field is required."); //Enter Phone Number corpEmployeeHelper.VerifyText("VerifyEmail", "This field is required."); //Enter Phone Number corpEmployeeHelper.VerifyText("VerifyPhoneNumber", "This field is required."); //Enter Phone Number corpEmployeeHelper.VerifyText("VerifyLastName", "This field is required."); //Enter First Name corpEmployeeHelper.TypeText("EnterFirstName", "Test"); //Enter Last Name corpEmployeeHelper.TypeText("EnterLastName", "Tester"); //Enter Primary Email var Email = "Email" + RandomNumber(1, 999) + "@yopmail.com"; corpEmployeeHelper.TypeText("EnterPrimaryEmail", Email); //Click On Check box corpEmployeeHelper.ClickElement("ClickOnCheckBox"); //Enter Phone Number corpEmployeeHelper.TypeText("EnterPhneNumber", "9898777332"); //Enter Eaddress var mail = "mail" + RandomNumber(1, 999) + "@yopmail.com"; corpEmployeeHelper.TypeText("EnterEaddress", mail); //Click On Save corpEmployeeHelper.ClickElement("ClickOnSave"); corpEmployeeHelper.WaitForWorkAround(4000); //verify Page Text corpEmployeeHelper.VerifyPageText("Employee Created Successfully."); corpEmployeeHelper.WaitForWorkAround(4000); //Search Employee corpEmployeeHelper.TypeText("SearchEmployee", "Test Tester"); //Enter Email To Search corpEmployeeHelper.TypeText("SearchEnterEmail", Email); corpEmployeeHelper.WaitForWorkAround(3000); //Click on Edit corpEmployeeHelper.ClickElement("ClickOnEdit"); corpEmployeeHelper.WaitForWorkAround(3000); //Enter zip code corpEmployeeHelper.TypeText("EnterZipCode", "60601"); corpEmployeeHelper.WaitForWorkAround(3000); //Enter First Name corpEmployeeHelper.TypeText("EnterFirstName", "Test"); //Enter Last Name corpEmployeeHelper.TypeText("EnterLastName", "Tester"); //Click On Save corpEmployeeHelper.ClickElement("ClickOnSave"); corpEmployeeHelper.WaitForWorkAround(4000); //Verify corpEmployeeHelper.VerifyPageText("Employee Details successfully updated"); corpEmployeeHelper.WaitForWorkAround(4000); } }
public void verifyResidualReportMailing() { 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 residual_income_officePayoutHelper = new ResidualIncome_OfficePayoutHelper(GetWebDriver()); // Variable random String JIRA = ""; String Status = "Pass"; try { executionLog.Log("VerifyResidualReportMailing", "Login with valid username and password"); Login(username[0], password[0]); executionLog.Log("VerifyResidualReportMailing", "Verify Page title"); VerifyTitle("Dashboard"); executionLog.Log("VerifyResidualReportMailing", "Go to Residual Income Reports"); VisitOffice("rir/reports"); residual_income_officePayoutHelper.WaitForWorkAround(2000); executionLog.Log("VerifyResidualReportMailing", "Select Reporting Period"); residual_income_officePayoutHelper.Select("ReportingPeriod", "2017-02-01"); executionLog.Log("VerifyResidualReportMailing", "Select File Date"); residual_income_officePayoutHelper.Select("FileDate", "2017-02-27"); executionLog.Log("VerifyResidualReportMailing", "Select Processor"); residual_income_officePayoutHelper.Select("Processor", "First Data North"); residual_income_officePayoutHelper.WaitForWorkAround(4000); executionLog.Log("VerifyResidualReportMailing", "Select File Format"); residual_income_officePayoutHelper.Select("FileFormat", "Pegasus"); executionLog.Log("VerifyResidualReportMailing", "Search Payouts"); residual_income_officePayoutHelper.ClickElement("SearchBtn"); residual_income_officePayoutHelper.WaitForWorkAround(6000); executionLog.Log("VerifyResidualReportMailing", "Verify Reports Generated"); residual_income_officePayoutHelper.VerifyPageText("NewThemeCorp Residual Reports"); executionLog.Log("VerifyResidualReportMailing", "Select Partner Agent"); residual_income_officePayoutHelper.ClickElement("DolphoWeerCheckBox"); executionLog.Log("VerifyResidualReportMailing", "Email PDF Residual Report to selected Partner Agent"); residual_income_officePayoutHelper.ClickElement("SendBtn"); residual_income_officePayoutHelper.WaitForWorkAround(2000); executionLog.Log("VerifyResidualReportMailing", "Verify Report is Emailed successfully"); residual_income_officePayoutHelper.VerifyPageText("Report Mail Sent Successfully."); } catch (Exception e) { } }
public void createProducts() { 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 products_ProductHelper = new Products_ProductHelper(GetWebDriver()); // Variable var name = "Test" + GetRandomNumber(); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("CreateProducts", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("CreateProducts", "Verify Page title"); VerifyTitle("Dashboard"); executionLog.Log("CreateProducts", "Redirect To Profucts"); VisitOffice("products"); products_ProductHelper.WaitForWorkAround(3000); executionLog.Log("CreateProducts", "Enter Name"); products_ProductHelper.TypeText("SearchProduct", "Apple"); products_ProductHelper.WaitForWorkAround(2000); var loc = "//table[@id='list1']//tr[2]//td[5]/a"; if (products_ProductHelper.IsElementPresent(loc)) { executionLog.Log("CreateProducts", "Redirect To Profucts"); VisitOffice("products/create"); products_ProductHelper.WaitForWorkAround(4000); executionLog.Log("CreateProducts", "Enter the name of the product"); products_ProductHelper.TypeText("Name", name); executionLog.Log("CreateProducts", "Select the category of the product"); products_ProductHelper.SelectByText("Category", "Broken"); executionLog.Log("CreateProducts", " Click On Category"); products_ProductHelper.ClickElement("AddCustomField"); products_ProductHelper.WaitForWorkAround(3000); executionLog.Log("CreateProducts", "Enter Filed name"); products_ProductHelper.TypeText("FieldName", "Test"); executionLog.Log("CreateProducts", "Select Type"); products_ProductHelper.Select("Type", "textbox"); executionLog.Log("CreateProducts", "Select Type"); products_ProductHelper.Select("ContentType", "text"); executionLog.Log("CreateProducts", "Enter Filed name"); products_ProductHelper.TypeText("DataLength", "10"); executionLog.Log("CreateProducts", "Select Data Validation"); products_ProductHelper.Select("DataValidation", "email"); executionLog.Log("CreateProducts", "Click on Required CheckBox"); products_ProductHelper.ClickElement("Required"); products_ProductHelper.WaitForWorkAround(1000); executionLog.Log("CreateProducts", "Enter Description"); products_ProductHelper.TypeText("Description", "THIS IS TESTING DESCRIPTION"); executionLog.Log("CreateProducts", " Click on Save button"); products_ProductHelper.ClickElement("Save1"); products_ProductHelper.WaitForElementPresent("Save", 5); executionLog.Log("CreateProducts", "Click on Save btn."); products_ProductHelper.ClickJS("Save"); products_ProductHelper.WaitForWorkAround(3000); executionLog.Log("CreateProducts", "Redirect To Profucts"); VisitOffice("products"); products_ProductHelper.WaitForWorkAround(3000); executionLog.Log("CreateProducts", "Enter Name to search"); products_ProductHelper.TypeText("SearchProduct", name); products_ProductHelper.WaitForWorkAround(3000); executionLog.Log("CreateProducts", "Click Delete btn "); products_ProductHelper.ClickElement("DeleteProduct"); executionLog.Log("CreateProducts", "Accept alert message. "); products_ProductHelper.AcceptAlert(); executionLog.Log("CreateProducts", "Wait for delete message. "); products_ProductHelper.WaitForText("Product Deleted Successfully", 10); } else { executionLog.Log("CreateProducts", "Redirect To Profucts"); VisitOffice("products/create"); products_ProductHelper.WaitForWorkAround(4000); executionLog.Log("CreateProducts", "Enter the product Name"); products_ProductHelper.TypeText("Name", "Apple"); executionLog.Log("CreateProducts", "Select the Category"); products_ProductHelper.SelectByText("Category", "Broken"); executionLog.Log("CreateProducts", " Click On Category"); products_ProductHelper.ClickElement("AddCustomField"); products_ProductHelper.WaitForWorkAround(3000); executionLog.Log("CreateProducts", "Enter Filed name"); products_ProductHelper.TypeText("FieldName", "Test"); executionLog.Log("CreateProducts", "Select Type"); products_ProductHelper.Select("Type", "textbox"); executionLog.Log("CreateProducts", "Select Type"); products_ProductHelper.Select("ContentType", "text"); executionLog.Log("CreateProducts", "Enter Filed name"); products_ProductHelper.TypeText("DataLength", "10"); executionLog.Log("CreateProducts", "Select Data Validation"); products_ProductHelper.Select("DataValidation", "email"); executionLog.Log("CreateProducts", "Click on Required CheckBox"); products_ProductHelper.ClickElement("Required"); products_ProductHelper.WaitForWorkAround(1000); executionLog.Log("CreateProducts", "Enter Description"); products_ProductHelper.TypeText("Description", "THIS IS TESTING DESCRIPTION"); executionLog.Log("CreateProducts", " Click on Save button"); products_ProductHelper.ClickElement("Save1"); products_ProductHelper.WaitForElementPresent("Save", 5); executionLog.Log("CreateProducts", "Save the product"); products_ProductHelper.ClickJS("Save"); products_ProductHelper.WaitForWorkAround(6000); products_ProductHelper.VerifyPageText("Product Created Successfully"); products_ProductHelper.WaitForWorkAround(2000); } } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("CreateProducts"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Create Products"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Create Products", "Bug", "Medium", "Products page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Create Products"); TakeScreenshot("CreateProducts"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\CreateProducts.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("CreateProducts"); string id = loginHelper.getIssueID("Create Products"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\CreateProducts.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Create Products"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Create Products"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("CreateProducts"); executionLog.WriteInExcel("Create Products", Status, JIRA, "Product Management"); } }
/// <summary> /// Main constructor /// </summary> /// <param name="p">the client's process object</param> public Client(Process p) { Process = p; Process.Exited += new EventHandler(process_Exited); Process.EnableRaisingEvents = true; // Wait until we can really access the process Process.WaitForInputIdle(); while (Process.MainWindowHandle == IntPtr.Zero) { Process.Refresh(); System.Threading.Thread.Sleep(5); } // Save a copy of the handle so the process doesn't have to be opened // every read/write operation Handle = Util.WinAPI.OpenProcess(Util.WinAPI.PROCESS_ALL_ACCESS, 0, (uint)Process.Id); PathFinder = new Pokemon.Util.AStarPathFinder(this); Inventory = new Objects.Inventory(this); BattleList = new Objects.BattleList(this); Map = new Objects.Map(this); Memory = new MemoryHelper(this); Window = new Window(this); IO = new IOHelper(this); Login = new LoginHelper(this); Dll = new DllHelper(this); Input = new InputHelper(this); Player = new PlayerHelper(this); // Save the start time (it isn't changing) startTime = Memory.ReadInt32(Addresses.Client.StartTime); }
public void adminCorpMeetingURLChange() { string[] username = null; string[] password = null; var oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); username = oXMLData.getData("settings/Credentials", "username_office"); password = oXMLData.getData("settings/Credentials", "password"); // Initializing the objects var executionLog = new ExecutionLog(); var loginHelper = new LoginHelper(GetWebDriver()); var officeActivities_MeetingHelper = new OfficeActivities_MeetingHelper(GetWebDriver()); // Variable var FirstName = "Test" + GetRandomNumber(); var LastName = "Tester" + GetRandomNumber(); var Number = "12345678" + GetRandomNumber(); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("AdminCorpMeetingURLChange", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("AdminCorpMeetingURLChange", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("AdminCorpMeetingURLChange", "Goto User Admin >> Corporate "); VisitOffice("mycorp"); officeActivities_MeetingHelper.WaitForWorkAround(1000); executionLog.Log("AdminCorpMeetingURLChange", "Select Activity >> Tasks"); officeActivities_MeetingHelper.Select("SelectActivityType", "Meetings"); officeActivities_MeetingHelper.WaitForWorkAround(2000); executionLog.Log("AdminCorpMeetingURLChange", "Click On Document "); officeActivities_MeetingHelper.ClickElement("OpenMeeting"); officeActivities_MeetingHelper.WaitForWorkAround(2000); executionLog.Log("AdminCorpMeetingURLChange", "Change the url with the url number of another office"); VisitOffice("viewactivity/meeting/1"); officeActivities_MeetingHelper.WaitForWorkAround(1000); executionLog.Log("AdminCorpMeetingURLChange", "Verify Validation"); officeActivities_MeetingHelper.WaitForText("You don't have privileges to view this office activity.", 10); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("AdminCorpMeetingURLChange"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Admin Corp Meeting URL Change"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Admin Corp Meeting URL Change", "Bug", "Medium", "Corporate page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Admin Corp Meeting URL Change"); TakeScreenshot("AdminCorpMeetingURLChange"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\AdminCorpMeetingURLChange.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("AdminCorpMeetingURLChange"); string id = loginHelper.getIssueID("Admin Corp Meeting URL Change"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\AdminCorpMeetingURLChange.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Admin Corp Meeting URL Change"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Admin Corp Meeting URL Change"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("AdminCorpMeetingURLChange"); executionLog.WriteInExcel("Admin Corp Meeting URL Change", Status, JIRA, "My Corp"); } }
public void CreateEvent() { var userName = "******"; var pwd = "987"; RunInScope(scope => { var loginHelper = new LoginHelper(scope.Driver.Instance); var eventsPage = loginHelper.LoginAndNavigateTo<EventsPage>(userName, pwd); eventsPage.InitEventCreation(EventTypes.Tickets); }); }
public void verifyDefaultValueOfPerPageDropdown() { 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_LeadsHelper = new Office_LeadsHelper(GetWebDriver()); // Variable String JIRA = ""; String Status = "Pass"; try { executionLog.Log("verifyDefaultValueOfPerPageDropdown", "Login with valid credential Username"); Login(username[0], password[0]); executionLog.Log("verifyDefaultValueOfPerPageDropdown", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); office_LeadsHelper.WaitForWorkAround(6000); executionLog.Log("verifyDefaultValueOfPerPageDropdown", "Goto Leads page."); VisitOffice("leads"); office_LeadsHelper.WaitForWorkAround(6000); executionLog.Log("verifyDefaultValueOfPerPageDropdown", "Open Advance filter."); office_LeadsHelper.ClickElement("AdvanceFilter"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("verifyDefaultValueOfPerPageDropdown", "Select Result Page per 10."); office_LeadsHelper.SelectByText("ResultsPerPage", "10"); executionLog.Log("verifyDefaultValueOfPerPageDropdown", "Click on apply button."); office_LeadsHelper.ClickJS("Apply"); executionLog.Log("verifyDefaultValueOfPerPageDropdown", "Open Advance filter."); office_LeadsHelper.ClickElement("AdvanceFilter"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("verifyDefaultValueOfPerPageDropdown", "Open Reset button."); office_LeadsHelper.ClickElement("ResetAdvFilter"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("verifyDefaultValueOfPerPageDropdown", "Open Advance filter."); office_LeadsHelper.ClickElement("AdvanceFilter"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("verifyDefaultValueOfPerPageDropdown", "Verify default value 100 in Result Per page dropdown."); office_LeadsHelper.VerifySelectedOption("//*[@id='pageresults']", "100"); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("verifyDefaultValueOfPerPageDropdown"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("verify Default Value Of PerPageDropdown"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("verify Default Value Of PerPage Dropdown", "Bug", "Medium", "Amex page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("verify Default Value Of PerPage Dropdown"); TakeScreenshot("verifyDefaultValueOfPerPageDropdown"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\verifyDefaultValueOfPerPageDropdown.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("verifyDefaultValueOfPerPageDropdown"); string id = loginHelper.getIssueID("verify Default Value Of Per Page Dropdown"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\verifyDefaultValueOfPerPageDropdown.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("verify Default Value Of PerPage Dropdown"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("verify Default Value Of Per Page Dropdown"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("verify Default Value Of PerPage Dropdown"); executionLog.WriteInExcel("verify Default Value Of Per Page Dropdown", Status, JIRA, "Office Lead"); } }
public void residualIncomeViewReportsCorp() { string[] username = null; string[] password = null; XMLParse oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); username = oXMLData.getData("settings/Credentials", "username"); password = oXMLData.getData("settings/Credentials", "password"); //Initializing the objects var loginHelper = new LoginHelper(GetWebDriver()); var clientHelper = new ClientsHelper(GetWebDriver()); var loginAsCorpHelper = new LoginAsCorpHelper(GetWebDriver()); var resdiualIncmeSkipHelper = new ResdiualIncmeSkipHelper(GetWebDriver()); var resdiualIncmeFstDataNrthHelperRevnueShareSet = new ResdiualIncmeFstDataNrthHelperRevnueShareSet(GetWebDriver()); var clientBugsHelper = new ClientBugsHelper(GetWebDriver()); //Login with valid credential Username loginAsCorpHelper.TypeText("EnterUsername", "selcorp"); //Login with valid credential password loginAsCorpHelper.TypeText("EnterPassword", "seWelcome2"); //Click On Login Button loginAsCorpHelper.ClickElement("ClickOnLoginButton"); //Verify Page title VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); //Click on Residual Income tab resdiualIncmeFstDataNrthHelperRevnueShareSet.ClickElement("ClickResidualIncomeTab"); //Click to Import resdiualIncmeFstDataNrthHelperRevnueShareSet.redirectToPage(); //Click On Import New button resdiualIncmeFstDataNrthHelperRevnueShareSet.ClickElement("ClickOnImportNew"); //Processor resdiualIncmeFstDataNrthHelperRevnueShareSet.Select("ProcessorType", "First Data North"); resdiualIncmeFstDataNrthHelperRevnueShareSet.WaitForWorkAround(3000); //Reporting Period resdiualIncmeFstDataNrthHelperRevnueShareSet.Select("ReportingPeriod", "11"); resdiualIncmeFstDataNrthHelperRevnueShareSet.Select("SelectYr", "2016"); //File Date clientBugsHelper.ClickElement("ClickOnFileDate"); //Click on Date clientBugsHelper.ClickElement("SelectDate"); var FileName = "D:\\pegqa\\TestAutomationProject\\PegasusTests\\Files\\FirstDataNorth_ResidualSamples - Small.csv"; resdiualIncmeFstDataNrthHelperRevnueShareSet.Upload("SelectBrowseCSVFile", FileName); resdiualIncmeFstDataNrthHelperRevnueShareSet.WaitForWorkAround(4000); //Import resdiualIncmeFstDataNrthHelperRevnueShareSet.ClickElement("ClickOnImportBtn"); resdiualIncmeFstDataNrthHelperRevnueShareSet.WaitForWorkAround(5000); //################################## SET FILTER ################################## //Select Filter ReportingPeriod resdiualIncmeFstDataNrthHelperRevnueShareSet.Select("SelectFiletReportingPeriod", "November 2016"); // Select Processor Filer resdiualIncmeFstDataNrthHelperRevnueShareSet.Select("SelectProcessorFiler", "First Data North"); //Select Filter FileFormat resdiualIncmeFstDataNrthHelperRevnueShareSet.Select("FilterFileFormat", "First Data North"); //Select Filter ReportingPeriod resdiualIncmeFstDataNrthHelperRevnueShareSet.TypeText("FileName", "FirstDataNorth_ResidualSamples - Small"); //Select Status resdiualIncmeFstDataNrthHelperRevnueShareSet.Select("SelectStatus", "Imported"); //############# CALCULATION WIZARD //Click On Calculation wizard resdiualIncmeFstDataNrthHelperRevnueShareSet.ClickElement("ClickOnCalculation"); resdiualIncmeFstDataNrthHelperRevnueShareSet.WaitForWorkAround(4000); //Click On Step1 resdiualIncmeFstDataNrthHelperRevnueShareSet.ClickElement("ClickOnSkipRecal1"); resdiualIncmeFstDataNrthHelperRevnueShareSet.WaitForWorkAround(6000); //Click on skip step 2 resdiualIncmeFstDataNrthHelperRevnueShareSet.ClickElement("ClickSkipStp2Recal"); resdiualIncmeFstDataNrthHelperRevnueShareSet.WaitForWorkAround(6000); // Publish Payout resdiualIncmeFstDataNrthHelperRevnueShareSet.ClickElement("PublishPayout"); // resdiualIncmeFstDataNrthHelper.elementpre(); resdiualIncmeFstDataNrthHelperRevnueShareSet.WaitForWorkAround(8000); //################################## SET FILTER ################################## //Select Filter ReportingPeriod resdiualIncmeFstDataNrthHelperRevnueShareSet.Select("SelectFiletReportingPeriod", "November 2016"); // Select Processor Filer resdiualIncmeFstDataNrthHelperRevnueShareSet.Select("SelectProcessorFiler", "First Data North"); //Select Filter FileFormat resdiualIncmeFstDataNrthHelperRevnueShareSet.Select("FilterFileFormat", "First Data North"); //Select Filter ReportingPeriod resdiualIncmeFstDataNrthHelperRevnueShareSet.TypeText("FileName", "FirstDataNorth_ResidualSamples - Small"); //Select Status resdiualIncmeFstDataNrthHelperRevnueShareSet.Select("SelectStatus", "Published"); resdiualIncmeFstDataNrthHelperRevnueShareSet.WaitForWorkAround(4000); //Click on Report View clientBugsHelper.ClickElement("CorpViewReports"); clientBugsHelper.WaitForWorkAround(4000); //Verify text Selenium Corp Residual Reports clientBugsHelper.VerifyPageText("Selenium Corp Residual Reports"); clientBugsHelper.WaitForWorkAround(4000); }
public void createOffice() { string[] username1 = null; string[] password1 = null; var oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); username1 = oXMLData.getData("settings/Credentials", "username_corp"); password1 = oXMLData.getData("settings/Credentials", "password"); // Initializing the objects var executionLog = new ExecutionLog(); var loginHelper = new LoginHelper(GetWebDriver()); var corpOffice_OfficeHelper = new CorpOffice_OfficeHelper(GetWebDriver()); // Variable random var username = "******" + GetRandomNumber(); var name = "Test" + GetRandomNumber(); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("CreateOffice", "Login with valid username and password"); Login(username1[0], password1[0]); executionLog.Log("CreateOffice", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("CreateOffice", "Go to office page"); VisitCorp("offices"); corpOffice_OfficeHelper.WaitForWorkAround(3000); executionLog.Log("CreateOffice", "Verify title"); VerifyTitle("Offices"); executionLog.Log("CreateOffice", "Click On Create button"); corpOffice_OfficeHelper.ClickElement("Create"); corpOffice_OfficeHelper.WaitForWorkAround(3000); executionLog.Log("CreateOffice", "Verify title"); VerifyTitle("Create an Office"); executionLog.Log("CreateOffice", "Enter Name"); corpOffice_OfficeHelper.TypeText("Name", name); executionLog.Log("CreateOffice", "Enter DBAName"); corpOffice_OfficeHelper.TypeText("DBAName", "TEST123"); executionLog.Log("CreateOffice", "Enter Website"); corpOffice_OfficeHelper.TypeText("Website", "TEST.COM"); executionLog.Log("CreateOffice", "Enter OfficeCode"); corpOffice_OfficeHelper.TypeText("OfficeCode", "12345"); executionLog.Log("CreateOffice", "Select Address"); corpOffice_OfficeHelper.Select("AddressType", "Office"); executionLog.Log("CreateOffice", "Enter AddressLine1"); corpOffice_OfficeHelper.TypeText("AddressLine1", "FC-89"); executionLog.Log("CreateOffice", "Enter ZipCode"); corpOffice_OfficeHelper.TypeText("ZIpCode", "60601"); executionLog.Log("CreateOffice", "Enter PrimaryUserName"); corpOffice_OfficeHelper.TypeText("PrimaryUserName", username); executionLog.Log("CreateOffice", "Click on AutoGenPassword checkbox"); corpOffice_OfficeHelper.ClickElement("AutoGenPassword"); executionLog.Log("CreateOffice", "Enter PrimaryPassword"); corpOffice_OfficeHelper.TypeText("PrimaryPassword", "pegasus"); executionLog.Log("CreateOffice", "Select Salutation"); corpOffice_OfficeHelper.Select("Salutation", "Mr"); //corpOffice_OfficeHelper.WaitForWorkAround(2000); executionLog.Log("CreateOffice", "Enter FirstName"); corpOffice_OfficeHelper.TypeText("FirstName", "Test"); executionLog.Log("CreateOffice", "Enter LastName"); corpOffice_OfficeHelper.TypeText("LastName", "Tester"); executionLog.Log("CreateOffice", "Enter eAddress"); corpOffice_OfficeHelper.TypeText("eAddress", "*****@*****.**"); executionLog.Log("CreateOffice", " Click on save button"); try { corpOffice_OfficeHelper.ClickElement("Save"); } catch (OpenQA.Selenium.WebDriverException) { } executionLog.Log("CreateOffice", "Verify text on the page"); corpOffice_OfficeHelper.WaitForText("Office created successfully.", 10); executionLog.Log("CreateOffice", "Go to office page"); VisitCorp("offices"); corpOffice_OfficeHelper.WaitForWorkAround(4000); executionLog.Log("CreateOffice", "Verify title"); VerifyTitle("Offices"); executionLog.Log("CreateOffice", "Enter Name to search"); corpOffice_OfficeHelper.TypeText("EnterSelenium", name); corpOffice_OfficeHelper.WaitForWorkAround(3000); executionLog.Log("CreateOffice", "Click Delete btn "); corpOffice_OfficeHelper.ClickElement("DeleteOffice"); executionLog.Log("CreateOffice", "Verify page text"); corpOffice_OfficeHelper.VerifyPageText("Are you sure want to delete the"); executionLog.Log("CreateOffice", "Click Delete btn "); corpOffice_OfficeHelper.ClickElement("ConfirmDelete"); executionLog.Log("CreateOffice", "Accept alert message. "); corpOffice_OfficeHelper.AcceptAlert(); executionLog.Log("CreateOffice", "Wait for delete message. "); corpOffice_OfficeHelper.WaitForText("Office deleted successfully.", 20); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("CreateOffice"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Create Office"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Create Office", "Bug", "Medium", "Office page", "QA", "Log in as: " + username1[0] + " / " + password1[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Create Office"); TakeScreenshot("CreateOffice"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\CreateOffice.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("CreateOffice"); string id = loginHelper.getIssueID("Create Office"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\CreateOffice.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Create Office"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Create Office"); executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("CreateOffice"); executionLog.WriteInExcel("Create Office", Status, JIRA, "Corp Office"); } }
// Logout from the application public void Logout() { LoginHelper = new LoginHelper(GetWebDriver()); LoginHelper.ClickUserIcon(); LoginHelper.ClickLogOff(); }
/// <summary> /// 发送get或post请求 /// </summary> /// <param name="url"></param> /// <param name="referer"></param> /// <param name="method"></param> /// <param name="parameters"></param> /// <returns></returns> public static string RequestWeb(string url, string referer = null, string method = "GET", Dictionary <string, string> parameters = null, int retry = 3) { // 重试次数 if (retry <= 0) { return(""); } // post请求,发送参数 if (method == "POST" && parameters != null) { StringBuilder builder = new StringBuilder(); int i = 0; foreach (var item in parameters) { if (i > 0) { builder.Append("&"); } builder.AppendFormat("{0}={1}", item.Key, item.Value); i++; } url += "?" + builder.ToString(); } try { HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); request.Method = method; request.Timeout = 30 * 1000; // MacOS Safari //string safari = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.1 Safari/605.1.15"; // Windows 10 Chrome string chrome = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.99 Safari/537.36"; request.UserAgent = chrome; //request.ContentType = "application/json,text/html,application/xhtml+xml,application/xml;charset=UTF-8"; request.Headers["accept-language"] = "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7"; request.Headers["accept-encoding"] = "gzip, deflate, br"; // referer if (referer != null) { request.Referer = referer; } // 构造cookie if (!url.Contains("getLogin")) { request.Headers["origin"] = "https://www.bilibili.com"; CookieContainer cookies = LoginHelper.GetLoginInfoCookies(); if (cookies != null) { request.CookieContainer = cookies; } } string html = string.Empty; using (HttpWebResponse response = (HttpWebResponse)request.GetResponse()) { if (response.ContentEncoding.ToLower().Contains("gzip")) { using (GZipStream stream = new GZipStream(response.GetResponseStream(), CompressionMode.Decompress)) { using (StreamReader reader = new StreamReader(stream, Encoding.UTF8)) { html = reader.ReadToEnd(); } } } else if (response.ContentEncoding.ToLower().Contains("deflate")) { using (DeflateStream stream = new DeflateStream(response.GetResponseStream(), CompressionMode.Decompress)) { using (StreamReader reader = new StreamReader(stream, Encoding.UTF8)) { html = reader.ReadToEnd(); } } } else if (response.ContentEncoding.ToLower().Contains("br")) { using (BrotliStream stream = new BrotliStream(response.GetResponseStream(), CompressionMode.Decompress)) { using (StreamReader reader = new StreamReader(stream, Encoding.UTF8)) { html = reader.ReadToEnd(); } } } else { using (Stream stream = response.GetResponseStream()) { using (StreamReader reader = new StreamReader(stream, Encoding.UTF8)) { html = reader.ReadToEnd(); } } } } return(html); } catch (WebException e) { Console.WriteLine("RequestWeb()发生Web异常: {0}", e); Logging.LogManager.Error(e); return(RequestWeb(url, referer, method, parameters, retry - 1)); } catch (IOException e) { Console.WriteLine("RequestWeb()发生IO异常: {0}", e); Logging.LogManager.Error(e); return(RequestWeb(url, referer, method, parameters, retry - 1)); } catch (Exception e) { Console.WriteLine("RequestWeb()发生其他异常: {0}", e); Logging.LogManager.Error(e); return(RequestWeb(url, referer, method, parameters, retry - 1)); } }
public void leadviewaddtocampaign() { string[] username = null; string[] password = null; var oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/OrganizationSetting.xml"); username = oXMLData.getData("settings/Credentials", "username"); password = oXMLData.getData("settings/Credentials", "password"); //Initializing the objects var loginHelper = new LoginHelper(GetWebDriver()); var AddEventsForLeadHelper = new AddEventsForLeadHelper(GetWebDriver()); //Login with valid username and password Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); //Verify Page title VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); //Click on Leads AddEventsForLeadHelper.ClickElement("ClickOnLeads"); //GetWebDriver().Navigate().GoToUrl("http://zaspire.com/infoaspire/leads"); //AddEventsForLeadHelper.WaitForWorkAround(7000); //Open Lead AddEventsForLeadHelper.ClickElement("FirstLeadNameLink"); //Click on Move over AddEventsForLeadHelper.ClickElement("MoveHover"); AddEventsForLeadHelper.WaitForWorkAround(10000); //################### LEADS ADD TO CAMPAIGN ######################### //Click on Add To Campaign AddEventsForLeadHelper.ClickElement("ClickOnAddToCampaign"); AddEventsForLeadHelper.WaitForWorkAround(4000); //Click on Merge Button AddEventsForLeadHelper.ClickElement("ClickOnMergeButton"); //Click On Campaign Name AddEventsForLeadHelper.ClickElement("ClickOnCampaignName"); //Select Campaign Group //AddEventsForLeadHelper.Select("SelectCampaignGroup", "10"); //Enter Add New Campaign Group Name AddEventsForLeadHelper.TypeText("EnterCampaignGroupName", "Test Group"); //Click On Add Leads AddEventsForLeadHelper.ClickElement("ClickOnAddLeads"); AddEventsForLeadHelper.AcceptAlert(); AddEventsForLeadHelper.WaitForWorkAround(10000); }
public void editAmexRatesCorpVerifyInOffice() { string[] username = null; string[] password = null; var oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); username = oXMLData.getData("settings/Credentials", "username"); password = oXMLData.getData("settings/Credentials", "password"); //Initializing the objects var loginHelper = new LoginHelper(GetWebDriver()); var clientHelper = new ClientsHelper(GetWebDriver()); var createAmexRateHelper = new CreateAmexRateHelper(GetWebDriver()); //Variable var Num = "1" + RandomNumber(1, 999); var Nam = "New" + RandomNumber(1, 999); var name = "Test" + RandomNumber(1, 99); var NewNum = "1" + RandomNumber(1, 99); //Login with valid username and password createAmexRateHelper.TypeText("EnterUsername", "selcorp"); //Login with valid username and password createAmexRateHelper.TypeText("EnterPassword", "seWelcome2"); //Login Button createAmexRateHelper.Click("//button[text()='Login']"); createAmexRateHelper.WaitForWorkAround(4000); //Verify Page title VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); //Redirect TO cRETAE GetWebDriver().Navigate().GoToUrl("https://www.pegasus-test.com/selcorp/masterdata/manage_amex_rates"); //Enter Processor name createAmexRateHelper.TypeText("MCCCode", Num); //Enter ProcessorCode createAmexRateHelper.TypeText("AmexRate", name); //Enter Amex Per Rate createAmexRateHelper.TypeText("AmexPerItem", Nam); //Click On Save Btn createAmexRateHelper.Click("//a[@title='Save']"); createAmexRateHelper.WaitForWorkAround(3000); //Verify Text The Amex Rates is successfully created!! createAmexRateHelper.VerifyPageText("The Amex Rates is successfully created!!"); //Search with MCC Codes createAmexRateHelper.TypeText("SecrhMCCCodes", Num); createAmexRateHelper.WaitForWorkAround(2000); //Click on Edit Save createAmexRateHelper.ClickElement("ClickOnEDit"); //Enter ProcessorCode createAmexRateHelper.TypeText("AmexRate", NewNum); //Enter Amex Per Rate createAmexRateHelper.TypeText("AmexPerItem", NewNum); //Click on Edit Save createAmexRateHelper.Click("//a[@title='Save']"); createAmexRateHelper.WaitForWorkAround(2000); //Verify The Amex Rates is successfully updated!! createAmexRateHelper.VerifyPageText("The Amex Rates is successfully updated!!"); createAmexRateHelper.WaitForWorkAround(2000); //Click To Push To Office Frm Corp createAmexRateHelper.ClickElement("PushOfficeFrmCorp"); createAmexRateHelper.AcceptAlert(); createAmexRateHelper.WaitForWorkAround(4000); createAmexRateHelper.VerifyPageText("Amex Rates successfully pushed to offices."); //Logout GetWebDriver().Navigate().GoToUrl("https://www.pegasus-test.com/selenium_corp/selenium_office/logout"); //Login with valid username and password Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); //Redirect To Admin // GetWebDriver().Navigate().GoToUrl("https://www.pegasus-test.com/selenium_corp/selenium_office/admin"); //Click on Master Data // createAmexRateHelper.ClickElement("ClickOnMaterOff"); //Redirect GetWebDriver().Navigate().GoToUrl("https://www.pegasus-test.com/selcorp/seloffice/amex_rates"); //Search with MCC Codes createAmexRateHelper.TypeText("SecrhMCCCodes", Num); createAmexRateHelper.WaitForWorkAround(2000); //Verify createAmexRateHelper.VerifyPageText(NewNum); createAmexRateHelper.WaitForWorkAround(3000); }
public void opportunitiesZipCode() { 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("OpportunitiesZipCode", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("OpportunitiesZipCode", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("OpportunitiesZipCode", "Redirect To URL"); VisitOffice("opportunities/create"); executionLog.Log("OpportunitiesZipCode", "Verify page title"); VerifyTitle("Create an Opportunity"); executionLog.Log("OpportunitiesZipCode", "Enter Address Line1"); office_OpportunitiesHelper.TypeText("AddressLine1Opp", "TEST ADDRESS LINE 1"); executionLog.Log("OpportunitiesZipCode", "Enter Zip Code"); office_OpportunitiesHelper.TypeText("ZipCodeOpp", "60601"); office_OpportunitiesHelper.WaitForWorkAround(2000); executionLog.Log("OpportunitiesZipCode", "Select MailingAddressLine1"); office_OpportunitiesHelper.TypeText("MailingAddLine1opp", "test"); executionLog.Log("OpportunitiesZipCode", "Enter Mailing Zip Code"); office_OpportunitiesHelper.TypeText("MailingZipCodeOpp", "30033"); office_OpportunitiesHelper.WaitForWorkAround(3000); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("OpportunitiesZipCode"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Opportunities Zip Code"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Opportunities Zip Code", "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 Zip Code"); TakeScreenshot("OpportunitiesZipCode"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\OpportunitiesZipCode.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("OpportunitiesZipCode"); string id = loginHelper.getIssueID("Opportunities Zip Code"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\OpportunitiesZipCode.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Opportunities Zip Code"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Opportunities Zip Code"); executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("OpportunitiesZipCode"); executionLog.WriteInExcel("Opportunities Zip Code", Status, JIRA, "Opportunities Management"); } }
public void resetPasswordOfficeUser() { string[] username = null; string[] password = null; XMLParse oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); username = oXMLData.getData("settings/Credentials", "username"); password = oXMLData.getData("settings/Credentials", "password"); //Initializing the objects LoginHelper loginHelper = new LoginHelper(GetWebDriver()); ClientsHelper clientHelper = new ClientsHelper(GetWebDriver()); ResetPasswordOfficeUserAdminHelper resetPasswordOfficeUserAdminHelper = new ResetPasswordOfficeUserAdminHelper(GetWebDriver()); // Variable String name = "TestTester" + RandomNumber(1, 99); String email = "Test" + RandomNumber(1, 999) + "@yopmail.com"; //Login with valid username and password Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); //Verify Page title VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); //Redirect To URL resetPasswordOfficeUserAdminHelper.RedirectToPage(); //Verify title VerifyTitle("selOffice's Users"); //################################# Create Master Category ############################################# // Click On Create resetPasswordOfficeUserAdminHelper.ClickElement("ClickOnCreate"); //Verify title VerifyTitle("Create User"); //Select Type resetPasswordOfficeUserAdminHelper.Select("UsreType", "Employee"); //Click on Create New resetPasswordOfficeUserAdminHelper.ClickElement("CreateNew"); //Enter USER NAME resetPasswordOfficeUserAdminHelper.TypeText("UserName", name); //#######################Employee detail //Select Salutation resetPasswordOfficeUserAdminHelper.Select("Salutation", "Mr"); //Enter FIRST NAME resetPasswordOfficeUserAdminHelper.TypeText("FirstName", "Test"); //Enter LastName resetPasswordOfficeUserAdminHelper.TypeText("LastName", " Tester"); //Enter Primary Email resetPasswordOfficeUserAdminHelper.TypeText("PrimaryEmail", email); //CLick on Admin resetPasswordOfficeUserAdminHelper.ClickElement("ClickOnAdminUser"); //cLICK on Save resetPasswordOfficeUserAdminHelper.ClickElement("ClickOnSave"); //Wait for text resetPasswordOfficeUserAdminHelper.WaitForText("The user is successfully added", 30); //###########################Reset Password //Select Status resetPasswordOfficeUserAdminHelper.Select("SelectStatus", ""); //Enter Email Search resetPasswordOfficeUserAdminHelper.TypeText("EmailResetFiled", email); resetPasswordOfficeUserAdminHelper.WaitForWorkAround(9000); //Verify text present resetPasswordOfficeUserAdminHelper.WaitForText(email, 20); //Click on User resetPasswordOfficeUserAdminHelper.ClickElement("ClickOnUser"); //Verify title VerifyTitle("Employee Detalis"); // Click on Reset Password resetPasswordOfficeUserAdminHelper.ClickElement("ClickonResetPassword"); //Accept Alert resetPasswordOfficeUserAdminHelper.AcceptAlert(); //No link in the email is present to reset password resetPasswordOfficeUserAdminHelper.WaitForText("Reset password link sent to ", 20); }
public void searchListManagementItem() { 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 listManagementHelper = new ListManagementHelper(GetWebDriver()); // Variable var name = "Test" + GetRandomNumber(); var name2 = "Testlist" + GetRandomNumber(); var Id = "12345" + GetRandomNumber(); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("SearchListManagementItem", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("SearchListManagementItem", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("SearchListManagementItem", "Redirect To List Management page"); listManagementHelper.ClickElement("Marketing"); listManagementHelper.WaitForWorkAround(4000); executionLog.Log("SearchListManagementItem", "Redirect To List Management page"); GetWebDriver().Navigate().GoToUrl("https://www.pegasus-test.com/en/listmanagements/clients"); listManagementHelper.WaitForWorkAround(2000); executionLog.Log("SearchListManagementItem", "Click on Create list"); listManagementHelper.ClickForce("Create"); listManagementHelper.WaitForWorkAround(1000); executionLog.Log("SearchListManagementItem", "Name the list"); listManagementHelper.TypeText("ListName", name); executionLog.Log("SearchListManagementItem", "Click on Create button"); listManagementHelper.ClickElement("Createbuttn"); listManagementHelper.WaitForWorkAround(1000); executionLog.Log("SearchListManagementItem", "Search the list name"); listManagementHelper.TypeText("SearchList", name); executionLog.Log("SearchListManagementItem", "verify the list name"); String listname = listManagementHelper.GetText("//ul[@id='listManagerGroup']/li/p"); executionLog.Log("SearchListManagementItem", "verify the list name"); Assert.AreEqual(listname, name); Console.WriteLine("List Rename successfull"); //executionLog.Log("SearchListManagementItem", "Click on list"); //listManagementHelper.ClickElement("Firstlist"); //listManagementHelper.WaitForWorkAround(1000); //executionLog.Log("SearchListManagementItem", "Rename the list"); //listManagementHelper.TypeText("Name", name2); //executionLog.Log("SearchListManagementItem", "Click on Back button"); //listManagementHelper.ClickElement("Backbutton"); //listManagementHelper.WaitForWorkAround(1000); //executionLog.Log("SearchListManagementItem", "Search the list name"); //listManagementHelper.TypeText("SearchList", name2); //executionLog.Log("SearchListManagementItem", "verify the list name"); //String listname = listManagementHelper.GetText("//ul[@id='listManagerGroup']/li/p"); //executionLog.Log("SearchListManagementItem", "verify the list name"); //Assert.AreEqual(listname, name2); //Console.WriteLine("List Rename successfull"); //executionLog.Log("SearchListManagementItem", "Delete List"); //listManagementHelper.MouseOver("//ul[@id='listManagerGroup']/li/p"); //listManagementHelper.WaitForWorkAround(2000); //executionLog.Log("SearchListManagementItem", "Delete List"); //listManagementHelper.ClickElement("DeleteList"); //executionLog.Log("SearchListManagementItem", "Click on Delete button"); //listManagementHelper.ClickElement("Deletebuttn"); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("SearchListManagementItem"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Search List Management Item"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Search List Management Item", "Bug", "Medium", "Equipment page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Rename ListManagement Item"); TakeScreenshot("SearchListManagementItem"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\SearchListManagementItem.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("SearchListManagementItem"); string id = loginHelper.getIssueID("Search List Management Item"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\SearchListManagementItem.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Search List Management Item"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Search List Management Item"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("SearchListManagementItem"); executionLog.WriteInExcel("Search List Management Item", Status, JIRA, "List Management"); } }
public void NotNeededTest() { var userName = "******"; var pwd = "987"; RunInScope(scope => { var loginHelper = new LoginHelper(scope.Driver.Instance); var eventsPage = loginHelper.LoginAndNavigateTo<EventsPage>(userName, pwd); }); }
//Login into the application public void login(string username,string password) { LoginHelper loginHelper = new LoginHelper(GetWebDriver()); loginHelper.type("username", username); loginHelper.type("password", password); loginHelper.ClickElement("Login"); }
public JsonResult LocationSet(string hoCode, string zoneCode, string regionCode, string unitCode) { LoginHelper objLoginHelper = new LoginHelper(); Common_ZoneInfo objZone = new Common_ZoneInfo(); Common_RegionInfo objRegion = new Common_RegionInfo(); Common_UnitInfo objUnit = new Common_UnitInfo(); string message = string.Empty, auditPrefix = "Audit- "; try { objLoginHelper = (LoginHelper)Session["LogInInformation"]; if (!string.IsNullOrEmpty(zoneCode)) { objZone = erpDal.Zone(zoneCode); objRegion = null; objUnit = null; } if (!string.IsNullOrEmpty(regionCode)) { objRegion = erpDal.Region(regionCode); } if (!string.IsNullOrEmpty(unitCode)) { objUnit = erpDal.Unit(unitCode); } objLoginHelper.LogInForZoneCode = string.Empty; objLoginHelper.LogInForZoneName = string.Empty; objLoginHelper.LogInForRegionCode = string.Empty; objLoginHelper.LogInForRegionName = string.Empty; objLoginHelper.LogInForUnitCode = string.Empty; objLoginHelper.LogInForUnitName = string.Empty; objLoginHelper.ZoneTitle = string.Empty; objLoginHelper.RegionTitle = string.Empty; objLoginHelper.UnitTitle = string.Empty; if (!string.IsNullOrEmpty(hoCode)) { objLoginHelper.Location = "HO"; objLoginHelper.LocationCode = "9000"; objZone = null; objRegion = null; objUnit = null; objLoginHelper.ModluleTitle = auditPrefix + "Head Office"; objLoginHelper.OfficeModule = Helper.HeadOfficeModule; objLoginHelper.UserOperationalRoleOrGroupID = UserGroup.HeadOfficeAudit; } if (objZone != null) { objLoginHelper.LogInForZoneCode = zoneCode; objLoginHelper.LogInForZoneName = objZone.Zone_Name; objLoginHelper.LocationCode = zoneCode; objLoginHelper.Location = "Zone"; objLoginHelper.ZoneTitle = "Zone: "; objLoginHelper.RegionTitle = string.Empty; objLoginHelper.UnitTitle = string.Empty; objLoginHelper.ModluleTitle = auditPrefix + "Zonal Module"; objLoginHelper.OfficeModule = Helper.ZonalOfficeModule; objLoginHelper.UserOperationalRoleOrGroupID = UserGroup.ZonalManager; } if (objRegion != null) { objLoginHelper.LogInForRegionCode = regionCode; objLoginHelper.LogInForRegionName = objRegion.Reg_Name; objLoginHelper.LocationCode = regionCode; objLoginHelper.Location = "Region"; objLoginHelper.RegionTitle = "Region: "; } if (objUnit != null) { objLoginHelper.LogInForUnitCode = unitCode; objLoginHelper.LogInForUnitName = objUnit.Unit_Name + " [" + unitCode + "]"; objLoginHelper.LocationCode = unitCode; objLoginHelper.Location = "Unit"; objLoginHelper.UnitTitle = "Unit: "; objLoginHelper.CustomerPrefix = objUnit.CUSTCODE_PREFIX + "-"; objLoginHelper.ModluleTitle = auditPrefix + "Unit Module"; objLoginHelper.OfficeModule = Helper.UnitOfficeModule; objLoginHelper.UserOperationalRoleOrGroupID = UserGroup.UnitOfficeUser; } objLoginHelper = securityDal.LoginInformation(objLoginHelper); String ipAddress = string.Empty, sMacAddress = string.Empty; ipAddress = IPNetworking.GetIP4Address(); if (String.IsNullOrEmpty(ipAddress)) { ipAddress = System.Web.HttpContext.Current.Request.UserHostAddress; } erpDal.CreateUserLog(ipAddress, sMacAddress, objLoginHelper.LocationCode, objLoginHelper.LogInID, "Auditor- Visit Location After Login"); //string auditOpenMonth = objLoginHelper.AuditorYearMonth; //objLoginHelper.YearMonthCurrent = auditOpenMonth; //objLoginHelper.AuditorYearMonth = Helper.YearMonthPrevious(auditOpenMonth, Helper.OneMonthPrevious); if (objLoginHelper.UerRoleOrGroupID == UserGroup.RegionManager) { objLoginHelper.URL = "HeadOffice/Auditor"; objLoginHelper.TopMenu = "SiteMenu/UnitAuditorMenu"; objLoginHelper.URLSelectionLocation = "RSFSecurity/LocationSelection"; } Session.Remove("LogInInformation"); Session["LogInInformation"] = objLoginHelper; message = "succeed"; } catch (Exception ex) { message = "notSucceed"; } return(new JsonResult { Data = message }); }
public void verfiyTicketSettingAssignedToAndManagerSave() { 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 ticket_SettingsHelper = new Ticket_SettingsHelper(GetWebDriver()); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("VerfiyTicketSettingAssignedToAndManagerSave", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("VerfiyTicketSettingAssignedToAndManagerSave", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("VerfiyTicketSettingAssignedToAndManagerSave", "Redirect at ticket topic page."); VisitOffice("tickets/settings"); ticket_SettingsHelper.WaitForWorkAround(3000); executionLog.Log("VerfiyTicketSettingAssignedToAndManagerSave", "Select set as Department"); ticket_SettingsHelper.ClickElement("SetDept"); ticket_SettingsHelper.Click("//*[@id='assign0Department']/option[1]"); executionLog.Log("VerfiyTicketSettingAssignedToAndManagerSave", "Select set as Assigned To"); ticket_SettingsHelper.SelectByText("SetAssignto", "Howard Tang"); executionLog.Log("VerfiyTicketSettingAssignedToAndManagerSave", "Select set as Assigned Manager"); ticket_SettingsHelper.SelectByText("SetAssignMgr", "Howard Tang"); executionLog.Log("VerfiyTicketSettingAssignedToAndManagerSave", "Click on Save button."); ticket_SettingsHelper.ClickElement("SaveBtn"); ticket_SettingsHelper.WaitForWorkAround(3000); executionLog.Log("VerfiyTicketSettingAssignedToAndManagerSave", "Verify settings saved"); ticket_SettingsHelper.VerifySlctdOptn("SetAssignto", "Howard Tang"); ticket_SettingsHelper.VerifySlctdOptn("SetAssignMgr", "Howard Tang"); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("VerfiyTicketSettingAssignedToAndManagerSave"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Verfiy Ticket Setting Assigned To And Manager Save"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Verfiy Ticket Setting Assigned To And Manager Save", "Bug", "Medium", "Ticket Admin page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Verfiy Ticket Setting Assigned To And Manager Save"); TakeScreenshot("VerfiyTicketSettingAssignedToAndManagerSave"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerfiyTicketSettingAssignedToAndManagerSave.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("VerfiyTicketSettingAssignedToAndManagerSave"); string id = loginHelper.getIssueID("Verfiy Ticket Setting Assigned To And Manager Save"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerfiyTicketSettingAssignedToAndManagerSave.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Verfiy Ticket Setting Assigned To And Manager Save"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Verfiy Ticket Setting Assigned To And Manager Save"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("VerfiyTicketSettingAssignedToAndManagerSave"); executionLog.WriteInExcel("Verfiy Ticket Setting Assigned To And Manager Save", Status, JIRA, "Admin Ticket settings"); } }
public JsonResult Login(FormCollection fCollection) { try { ArrayList logInMessage = new ArrayList(); UserInformation userInfo = new UserInformation(); userInfo = securityDal.ReadUserInformation(fCollection["txtUserName"], fCollection["txtPassword"], Helper.Active); if (userInfo != null) { objLoginHelper = securityDal.LoginInformation(fCollection, userInfo); String ipAddress = string.Empty, sMacAddress = string.Empty; ipAddress = IPNetworking.GetIP4Address(); // ipAddress = System.Web.HttpContext.Current.Request.UserHostAddress; // Use it Or the below one for get Visitors IP address if (String.IsNullOrEmpty(ipAddress)) { ipAddress = Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; if (ipAddress == null) { ipAddress = Request.ServerVariables["REMOTE_ADDR"]; } } //sMacAddress = NetworkUtility.GetMacAddress(NetworkUtility.GetMacAddress(ipAddress)); erpDal.CreateUserLog(ipAddress, sMacAddress, objLoginHelper.LocationCode, objLoginHelper.LogInID, "Login"); Session["LogInInformation"] = objLoginHelper; return(new JsonResult { Data = ExceptionHelper.ExceptionMessage(string.Empty, "Valid", Helper.URL(objLoginHelper)) }); } else { return(new JsonResult { Data = ExceptionHelper.ExceptionMessage("Sorry, UserId/Password Is Not Valid.", "error", string.Empty) }); } //RASolarERPDAL objModuleDal = new RASolarERPDAL(); //ViewBag.RSFModule = objModuleDal.RSFERPModuleDataForCombo(); //ViewBag.UserValidation = false; //return View(); //aa = fCollection["ddlZone"]; //aa = fCollection["ddlRegion"]; //aa = fCollection["ddlUnit"]; //aa = fCollection["txtUserName"]; //aa = fCollection["txtPassword"]; } catch (Exception ex) { return(new JsonResult { Data = ExceptionHelper.ExceptionMessage(ex) }); } }
public void saleAgentValidationFutureDate() { 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 agent_1099SaleAagentHelper = new Agent_1099SalesAgentHelper(GetWebDriver()); // Variable random String JIRA = ""; String Status = "Pass"; try { executionLog.Log("SaleAgentValidationFutureDate", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("SaleAgentValidationFutureDate", "Verify Page title"); VerifyTitle("Dashboard"); executionLog.Log("SaleAgentValidationFutureDate", "Redirect To Create Agent"); VisitOffice("sales_agents/create"); executionLog.Log("SaleAgentValidationFutureDate", "Wait for elelment to present."); agent_1099SaleAagentHelper.WaitForElementPresent("SelectSalutation", 08); executionLog.Log("SaleAgentValidationFutureDate", "Select Salutation"); agent_1099SaleAagentHelper.Select("SelectSalutation", "Mr"); executionLog.Log("SaleAgentValidationFutureDate", "Enter FirstName"); agent_1099SaleAagentHelper.TypeText("FirstNAME", "Test Sale gent"); executionLog.Log("SaleAgentValidationFutureDate", "Enter LastName"); agent_1099SaleAagentHelper.TypeText("LastName", "Tester"); executionLog.Log("SaleAgentValidationFutureDate", "Enter Date Of Birth"); agent_1099SaleAagentHelper.TypeText("BirthDay", "2018-03-02"); executionLog.Log("SaleAgentValidationFutureDate", "Select eAddressType"); agent_1099SaleAagentHelper.Select("eAddressType", "E-Mail"); executionLog.Log("SaleAgentValidationFutureDate", "Select eAddressLebel"); agent_1099SaleAagentHelper.Select("eAddressLebel", "Work"); executionLog.Log("SaleAgentValidationFutureDate", "Enter eAddress"); agent_1099SaleAagentHelper.TypeText("eAddress", "*****@*****.**"); executionLog.Log("SaleAgentValidationFutureDate", "Select SelectPhoneType"); agent_1099SaleAagentHelper.Select("SelectPhoneType", "Work"); executionLog.Log("SaleAgentValidationFutureDate", "Select Address Type "); agent_1099SaleAagentHelper.Select("AddressType", "Office"); executionLog.Log("SaleAgentValidationFutureDate", "Enter AddressLine1"); agent_1099SaleAagentHelper.TypeText("AddressLine1", "FC 89"); executionLog.Log("SaleAgentValidationFutureDate", "Enter Postal code"); agent_1099SaleAagentHelper.TypeText("PostalCode", "60601"); executionLog.Log("SaleAgentValidationFutureDate", "CLICK On Save"); agent_1099SaleAagentHelper.ClickElement("SaveSaleAgent"); agent_1099SaleAagentHelper.WaitForText("Age should be greater than 18.", 10); agent_1099SaleAagentHelper.WaitForWorkAround(3000); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("SaleAgentValidationFutureDate"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Sale Agent Validation Future Date"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Sale Agent Validation Future Date", "Bug", "Medium", "Sale Agent page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Sale Agent Validation Future Date"); TakeScreenshot("SaleAgentValidationFutureDate"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\SaleAgentValidationFutureDate.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("SaleAgentValidationFutureDate"); string id = loginHelper.getIssueID("Sale Agent Validation Future Date"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\SaleAgentValidationFutureDate.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Sale Agent Validation Future Date"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Sale Agent Validation Future Date"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("SaleAgentValidationFutureDate"); executionLog.WriteInExcel("Sale Agent Validation Future Date", Status, JIRA, "Agents Portal"); } }
// Logout from the application public void Logout() { LoginHelper = new LoginHelper(GetWebDriver()); LoginHelper.ClickUserIcon(); LoginHelper.WaitForWorkAround(2000); LoginHelper.ClickLogOff(); }
public void createEditAvators() { string[] username = null; string[] password = null; var oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); username = oXMLData.getData("settings/Credentials", "username_corp"); password = oXMLData.getData("settings/Credentials", "password"); // Initializing the objects var executionLog = new ExecutionLog(); var loginHelper = new LoginHelper(GetWebDriver()); var corpSystem_AvtarsHelper = new CorpSystem_AvtarsHelper(GetWebDriver()); // Variable random var AvaName = "AvaTest" + RandomNumber(44, 777); var name = "Test" + RandomNumber(99, 999); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("CreateEditAvators", "Login with valid username and password"); Login(username[0], password[0]); executionLog.Log("CreateEditAvators", "Verify Page title"); VerifyTitle("Dashboard"); executionLog.Log("CreateEditAvators", "Redirect at avatars Create page."); VisitCorp("avatars/create"); corpSystem_AvtarsHelper.WaitForWorkAround(4000); executionLog.Log("CreateEditAvators", "Enter Avatar Name"); corpSystem_AvtarsHelper.TypeText("AvatarName", AvaName); executionLog.Log("CreateEditAvators", "Select User Type"); corpSystem_AvtarsHelper.SelectByText("SelectUserType", "Employee"); corpSystem_AvtarsHelper.WaitForWorkAround(3000); executionLog.Log("CreateEditAvators", "Click onSave"); corpSystem_AvtarsHelper.ClickElement("Save"); corpSystem_AvtarsHelper.WaitForWorkAround(2000); executionLog.Log("CreateEditAvators", "Wait for confirmation"); corpSystem_AvtarsHelper.WaitForText("Avatar has been created.", 30); executionLog.Log("CreateEditAvators", "Search Avatars"); corpSystem_AvtarsHelper.TypeText("SearchAvatars", AvaName); corpSystem_AvtarsHelper.WaitForWorkAround(3000); executionLog.Log("CreateEditAvators", "Click Edit Avator"); corpSystem_AvtarsHelper.ClickElement("ClickEditAvator"); corpSystem_AvtarsHelper.WaitForWorkAround(5000); executionLog.Log("CreateEditAvators", "Click on Save"); corpSystem_AvtarsHelper.ClickJS("Save"); corpSystem_AvtarsHelper.WaitForWorkAround(3000); executionLog.Log("CreateEditAvators", "Search Avatars"); corpSystem_AvtarsHelper.TypeText("SearchAvatars", AvaName); corpSystem_AvtarsHelper.WaitForWorkAround(6000); executionLog.Log("CreateEditAvators", "Click on delete icon"); corpSystem_AvtarsHelper.ClickElement("DeleteIcon"); corpSystem_AvtarsHelper.AcceptAlert(); corpSystem_AvtarsHelper.WaitForWorkAround(3000); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("CreateEditAvators"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Create Edit Avators"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Create Edit Avators", "Bug", "Medium", "Corp Avatar page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Create Edit Avators"); TakeScreenshot("CreateEditAvators"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\CreateEditAvators.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("CreateEditAvators"); string id = loginHelper.getIssueID("Create Edit Avators"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\CreateEditAvators.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Create Edit Avators"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Create Edit Avators"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("CreateEditAvators"); executionLog.WriteInExcel("Create Edit Avators", Status, JIRA, "Corp System"); } }
public void one000Added() { string[] username = null; string[] password = null; string[] log = null; var oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); username = oXMLData.getData("settings/Credentials", "username"); password = oXMLData.getData("settings/Credentials", "password"); log = oXMLData.getData("settings/URL", "logout"); //Initializing the objects var loginHelper = new LoginHelper(GetWebDriver()); var partnerAgentHelperNewSkin = new PartnerAgentHelperNewSkin(GetWebDriver()); //Login with valid username and password Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); //Verify Page title VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); //Go to client page GetWebDriver().Navigate().GoToUrl("https://www.pegasus-test.com/selcorp/seloffice/clients"); //Verify title VerifyTitle("Clients"); //Click on Advance filter partnerAgentHelperNewSkin.ClickElement("Advance"); //Veirfy website is available under the filter partnerAgentHelperNewSkin.verifyElementPresent("PegResult"); //Go to contact page GetWebDriver().Navigate().GoToUrl("https://www.pegasus-test.com/selcorp/seloffice/contacts"); //Verify title VerifyTitle("Contacts"); //Click on Advance filter partnerAgentHelperNewSkin.ClickElement("Advance"); //Veirfy website is available under the filter partnerAgentHelperNewSkin.verifyElementPresent("PegResult"); //Go to Tickets page GetWebDriver().Navigate().GoToUrl("https://www.pegasus-test.com/selcorp/seloffice/tickets"); //Verify title VerifyTitle("Tickets"); //Click on Advance filter partnerAgentHelperNewSkin.ClickElement("Advance"); //Veirfy website is available under the filter partnerAgentHelperNewSkin.verifyElementPresent("PegResult"); //Logout from the application GetWebDriver().Navigate().GoToUrl(log[0]); }
public void TicketRestoreTester() { 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 restoreTicketHelper = new RestoreTicketHelper(GetWebDriver()); username = oXMLData.getData("settings/Credentials", "username_office"); password = oXMLData.getData("settings/Credentials", "password"); // Variable var FName = "Test" + RandomNumber(99, 99999); var LName = "Test" + RandomNumber(99, 99999); var CDBA = "New" + RandomNumber(99, 99999); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("RestoreTicket", "Login with valid credential Username"); Login(username[0], password[0]); executionLog.Log("RestoreTicket", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("RestoreTicket", "Create a ticket"); VisitOffice("tickets/create"); restoreTicketHelper.WaitForWorkAround(2000); executionLog.Log("RestoreTicket", "Input Subject Name"); restoreTicketHelper.TypeText("Subject", "TestRestore"); executionLog.Log("RestoreTicket", "Select Client"); restoreTicketHelper.ClickElement("SelectClient"); restoreTicketHelper.ClickElement("FirstClient"); executionLog.Log("RestoreTicket", "Select Client"); restoreTicketHelper.SelectByText("Status", "Open"); executionLog.Log("RestoreTicket", "Save"); restoreTicketHelper.ClickElement("Save"); restoreTicketHelper.WaitForWorkAround(3000); executionLog.Log("RestoreTicket", "get ID"); string Tid = restoreTicketHelper.getId(); VisitOffice("tickets/create"); } catch (Exception e) { // Console.WriteLine("ERRROROOR"); // executionLog.Log("Error", e.StackTrace); // Status = "Fail"; // String counter = executionLog.readLastLine("counter"); // String Description = executionLog.GetAllTextFile("ticketDraft"); // String Error = executionLog.GetAllTextFile("Error"); // if (counter == "") // { // counter = "0"; // } // bool result = loginHelper.CheckExstingIssue("ticketDraft"); // if (!result) // { // if (Int16.Parse(counter) < 5) // { // executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); // loginHelper.CreateIssue("ticketDraft", "Bug", "Medium", "Office page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); // string id = loginHelper.getIssueID("ticketDraft"); // TakeScreenshot("ticketDraft"); // string directoryName = loginHelper.GetnewDirectoryName(GetPath()); // var location = directoryName + "\\ticketDraft"; // loginHelper.AddAttachment(location, id); // } // } // else // { // if (Int16.Parse(counter) < 5) // { // executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); // TakeScreenshot("ticketDraft"); // string id = loginHelper.getIssueID("ticketDraft"); // string directoryName = loginHelper.GetnewDirectoryName(GetPath()); // var location = directoryName + "\\ticketDraft"; // loginHelper.AddAttachment(location, id); // loginHelper.AddComment(loginHelper.getIssueID("ticketDraft"), "This issue is still occurring"); // } // } // JIRA = loginHelper.getIssueID("ticketDraft"); // executionLog.DeleteFile("Error"); // throw; //} //finally //{ // // executionLog.DeleteFile("ticketDraft"); // executionLog.WriteInExcel("ticketDraft", Status, JIRA, "Office"); //} } }