I came across a situation where I need to wait until an element disappears (in firefox). So I tried different options but nothing worked so tried using
new WebDriverWait(Drivers._driverInstance, new TimeSpan(0, 0, 2)).Until(ExpectedConditions.InvisibilityOfElementLocated(locator));
This worked but it takes 26 seconds to run the test case. When I commented that sentence it took half of the time. Why does this particular method takes more time. Though I mentioned only 2 seconds it's waiting for nearly 10 seconds. Why is it doing so? Is there a quicker way to wait until element disappears.
Thanks.