private static void AssertCannotToggle(IWebElement element) { try { element.Click(); Assert.Fail(string.Format(assertCannotPerformActionFormat_action_element, "toggle", Describe(element))); } catch (InvalidElementStateException) { //Expected } }