To wait for an element to exist, you have to do this:
var element = app.FindName(
In my silverlight application, at some point I have to wait for either elementA to exist or elementB to exist. So I created two tasks that each wait for one of the elements to exist:
var waitForElementATask = Task.Factory.StartNew(() => WaitForElement(
var waitForElementBTask = Task.Factory.StartNew(() => WaitForElement(
with WaitForElement() being:
var element = app.FindName(name);
I thought this would be a good way to find out which one of the two elements show up. However, when I run this code, neither element will ever be found, even though they do show up.
Anybody has any ideas?