public void DeactivateAService() { // Creates a toggle for the given test, adds all log events under it test = extent.StartTest("Deactivate A Service Listing"); // Calling Manage Listing and Deactivate a Service ManageListing ManageListingObj = new ManageListing(); ManageListingObj.ViewManageListingPage(); try { bool status = ManageListingObj.DeActivateService(); Assert.False(status); // Screenshot string img = SaveScreenShotClass.SaveScreenshot(GlobalDefinitions.driver, "DeActivate Service"); test.Log(LogStatus.Info, "DeActivated Service Successfully" + img); } catch (Exception e) { Base.test.Log(LogStatus.Error, "Error in De-Activating Service : " + e.Message); } }