Selenium waitForCondition
waitForCondition
is for Javascript calls only, not for waiting for elements to load.
What you have in isElementPresent
is fine. I would combine it with explicit waits to be a bit more accurate about when an element is actually loaded and present on the screen:
C#
You can do it like this:
First of all you can set timeout value for the condition.
Then you can use the condition.
var Wait = new WebDriverWait(GlobalDriver, TimeSpan.FromMinutes(1));Wait.Until(ExpectedConditions.PresenceOfAllElementsLocatedBy(By.XPath("xPath"))));
OR
Wait.Until(driver => driver.FindElement(By.XPath("xPath")));
Thats all.