How to verify that Element is Removed from UI or not within certain time amount?

how can I verify DISAPPEARANCE of ELEMENTS in ANDROID UI Using Appuim Selenium.
as If, I will Provide it will show no element found exception.

Please Help.
Thanks.
AJ.

AJ,

You can set up your logic to catch the exception and only report success in that case. Here’s a ruby version of such a method:

def element_present?(element)
begin
find_element(…, element)
true
rescue SomeException
false
end
end

We used this method, but found that when an element is not present, there’s a significant timeout (seven seconds) while searching for the element. Instead, we call appium_driver.page_source, convert the XML to a string and search the string for a key:value pair, such as resource-id:resource-id-name