I am trying to test a web page that has ajax calls to update a price. An ajax call is fired on page load to update an initially empty div.
This is the extension method I'm using to wait for a change in the inner text of the div.
public static void WaitForTextChange(this IE ie, string id)
{
string old = ie.Element(id).Text;
ie.Element(id).WaitUntil(!Find.ByText(old));
}
However it's not pausing even though when I write out the old value and ie.Element(id).Text after the wait, they are both null. I can't debug as this acts as a pause.
Can the Find.ByText not handle nulls or have I got something wrong.
Has anyone got some code working similar to this?