// Waiting for an element to disappear with a timeout of 5 seconds RunningApp.WaitForNoElement("elementName", timeout: TimeSpan.FromSeconds(5));
// Waiting for an element to disappear with a custom message if it does not disappear try { RunningApp.WaitForNoElement("elementName", timeout: TimeSpan.FromSeconds(5), postTimeoutMessage: "Element did not disappear"); } catch (Exception ex) { Assert.IsTrue(ex.Message.Contains("Element did not disappear")); }In this example, we are waiting for an element with the name "elementName" to disappear from the UI. We have set a timeout of 5 seconds and provided a custom post-timeout message. If the element is still present after 5 seconds, the method will throw an exception with the custom message. We have used an Assert statement to verify that the message contains the expected text. Package/library: Xamarin.UITest.