public void cdrNight() { //string branch = TestContext.DataRow["Branch"].ToString(); //string account = TestContext.DataRow["CustomerAcc"].ToString(); //string transit = TestContext.DataRow["CustomerTransit"].ToString(); string sequence = seq.ToString(); //string action = TestContext.DataRow["Action"].ToString(); // string branch = TestContext.DataRow["Date"].ToString(); string branch = "12345"; string transit = TestContext.DataRow["Time"].ToString(); string account = TestContext.DataRow["Sequence"].ToString(); // string action = TestContext.DataRow["Classification"].ToString(); Playback.PlaybackSettings.SendKeysAsScanCode = true; //if (branch.Length > 0 && account.Length == 0 && transit.Length == 0 && action.Equals("Open Branch")) //{ // this.UIMap.OpenBranchParams.UIItemEditText = branch; // assign branch transit text box value =12345 // this.UIMap.OpenBranch(); // call your recorded method //} Combined objCombinedClasses = new Combined(); string text = objCombinedClasses.PutCheck(); if (text != branch) { DefferedDeposit objDefferedDeposit = new DefferedDeposit(); objDefferedDeposit.CloseBranch(); NightDeposit objNightDeposit = new NightDeposit(); objNightDeposit.NightDepositTab(); this.UIMap.OpenBranchParams.UIItemEditText = branch; // assign branch transit text box value =12345 this.UIMap.OpenBranch(); // call your recorded method this.UIMap.EnterAccandTransitParams.UIItemEditText = account; //setting the values to account text box : values that you read from CSV file this.UIMap.EnterAccandTransitParams.UIItemEditText1 = transit; //setting the values to transit text box : values that you read from CSV file this.UIMap.EnterAccandTransit(); // Call your method Playback.Wait(1000); //if (action.Equals("Match Envelope")) //{ // string newTransit = transit.Insert(5, "-"); // this.UIMap.SelectandMatchDepositParams.UIItemListSelectedItemsAsString = newTransit; // this.UIMap.SelectandMatchDeposit(); // Playback.Wait(1000); // this.UIMap.SaveDepositParams.UIItemEditText = sequence; // this.UIMap.SaveDeposit(); // Playback.Wait(2000); //} //else if (action.Equals("New Deposit")) //{ this.UIMap.NewDepositParams.UIItemEditText2 = sequence; //seq number is a static variable : which is incremented by the constructor every time codedui executes a new row this.UIMap.NewDeposit(); //} } else if (text == branch && account.Length > 0 && transit.Length > 0) { this.UIMap.EnterAccandTransitParams.UIItemEditText = account; //setting the values to account text box : values that you read from CSV file this.UIMap.EnterAccandTransitParams.UIItemEditText1 = transit; //setting the values to transit text box : values that you read from CSV file this.UIMap.EnterAccandTransit(); // Call your method Playback.Wait(1000); //if (action.Equals("Match Envelope")) //{ // string newTr ansit = transit.Insert(5, "-"); // this.UIMap.SelectandMatchDepositParams.UIItemListSelectedItemsAsString = newTransit; // this.UIMap.SelectandMatchDeposit(); // Playback.Wait(1000); // this.UIMap.SaveDepositParams.UIItemEditText = sequence; // this.UIMap.SaveDeposit(); // Playback.Wait(2000); //} //else if (action.Equals("New Deposit")) //{ this.UIMap.NewDepositParams.UIItemEditText2 = sequence; //seq number is a static variable : which is incremented by the constructor every time codedui executes a new row this.UIMap.NewDeposit(); //} } //this.UIMap.CloseBranch(); //this.UIMap.ExitCDR(); }
public void CodedUITestMethod1(string branchTransitNumber, string transactionSequenceNumber, string teller, string text) { // To generate code for this test, select "Generate Code for Coded UI Test" from the shortcut menu and select one of the menu items. // For more information on generated code, see http://go.microsoft.com/fwlink/?LinkId=179463 this.branchTransitNumber = branchTransitNumber; this.transactionSequenceNumber = transactionSequenceNumber; this.teller = teller; this.text = text; Playback.PlaybackSettings.SendKeysAsScanCode = true; if (text == "12345") { objDefferedDeposit.ClickDeferredDepositTab(); objDefferedDeposit.CloseBranch(); branchNumber = branchTransitNumber; objDefferedDeposit.OpenBranchParams.UIItemEditText = branchTransitNumber; objDefferedDeposit.OpenBranch(); objDefferedDeposit.MatchDepositParams.UIOMATransSeqNoEditText = transactionSequenceNumber; objDefferedDeposit.MatchDepositParams.UIItemListSelectedItemsAsString = teller; objDefferedDeposit.MatchDepositParams.UIDepositserialnumberEditText = depositSerialNumber.ToString(); objDefferedDeposit.MatchDeposit(); } else { if (branchNumber == branchTransitNumber) { objDefferedDeposit.MatchDepositParams.UIOMATransSeqNoEditText = transactionSequenceNumber; objDefferedDeposit.MatchDepositParams.UIItemListSelectedItemsAsString = teller; objDefferedDeposit.MatchDepositParams.UIDepositserialnumberEditText = depositSerialNumber.ToString(); objDefferedDeposit.MatchDeposit(); } else { try { objDefferedDeposit.CloseBranch(); branchNumber = branchTransitNumber; objDefferedDeposit.OpenBranchParams.UIItemEditText = branchTransitNumber; objDefferedDeposit.OpenBranch(); objDefferedDeposit.MatchDepositParams.UIOMATransSeqNoEditText = transactionSequenceNumber; objDefferedDeposit.MatchDepositParams.UIItemListSelectedItemsAsString = teller; objDefferedDeposit.MatchDepositParams.UIDepositserialnumberEditText = depositSerialNumber.ToString(); objDefferedDeposit.MatchDeposit(); } catch (Exception ex) { branchNumber = branchTransitNumber; objDefferedDeposit.OpenBranchParams.UIItemEditText = branchTransitNumber; objDefferedDeposit.OpenBranch(); objDefferedDeposit.MatchDepositParams.UIOMATransSeqNoEditText = transactionSequenceNumber; objDefferedDeposit.MatchDepositParams.UIItemListSelectedItemsAsString = teller; objDefferedDeposit.MatchDepositParams.UIDepositserialnumberEditText = depositSerialNumber.ToString(); objDefferedDeposit.MatchDeposit(); } } } }