public void Payment(String type = null) { List <string> temp = new List <string> { "credit", "transfer", "internaltransfer" }; int index = (type == null)? GenericUtils.GetRandomNumber(0, temp.Count() - 1) :temp.FindIndex(s => s.ToLower().Contains(type)); switch (temp[index]) { case "credit": EnterCreditCard(); break; case "transfer": True.ClickCustom("Transfer", driver); FiRoutingNumber.SendKeysWrapper(Configuration.Parameter.Get <string>("RoutingNumber"), "RoutingNumber", driver); acctNumber.SendKeysWrapper(Configuration.Parameter.Get <string>("AccountNumber"), "AccountNumber", driver); break; case "internaltransfer": InternalTransfer.ClickCustom("InternalTransfer", driver); acctNumber.SendKeysWrapper(Configuration.Parameter.Get <string>("AccountNumber"), "AccountNumber", driver); break; } submitApplicationButton.ClickCustom("Submit", driver); }