public void BTA1032_ST1265_SOAP_AuthenticateMember_IdentityTypeNotExists() { testCase = new TestCase(TestContext.TestName); listOfTestSteps = new List <TestStep>(); testStep = new TestStep(); String stepName = ""; try { Logger.Info("Test Method Started"); Common common = new Common(this.DriverContext); CDIS_Service_Methods cdis_Service_Method = new CDIS_Service_Methods(common); testStep = TestStepHelper.StartTestStep(testStep); stepName = "Authenticating a Member with identity type not exists and validate the Error as 3304"; string memberIdentity = ""; memberIdentity = common.RandomNumber(7); string value = DatabaseUtility.GetFromSoapDB("lw_virtualcard", "LOYALTYIDNUMBER", memberIdentity, "LOYALTYIDNUMBER", string.Empty); while (value == memberIdentity) { memberIdentity = common.RandomNumber(7); value = DatabaseUtility.GetFromSoapDB("lw_virtualcard", "LOYALTYIDNUMBER", memberIdentity, "LOYALTYIDNUMBER", string.Empty); } var output = cdis_Service_Method.AuthenticateMemberInvalid("invalidIdentity", memberIdentity, "Password1*", string.Empty); if (output.Contains("Error code=3304") && output.Contains("Error Message=Invalid identityType 'invalidIdentity' provided for authenticate member")) { testStep.SetOutput("The Error message from Service is received as expected. " + output); Logger.Info("The Error message from Service is received as expected. " + output); } else { throw new Exception("Error not received as expected error:3004. Actual error received is" + output); } testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); testCase.SetStatus(true); } catch (Exception e) { testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, false, DriverContext.SendScreenshotImageContent("API")); listOfTestSteps.Add(testStep); testCase.SetStatus(false); testCase.SetErrorMessage(e.Message); Assert.Fail(e.Message); } finally { testCase.SetTestCaseSteps(listOfTestSteps); testCase.SetEndTime(new StringHelper().GetFormattedDateTimeNow()); listOfTestCases.Add(testCase); } }