This is a migrated thread and some comments may be shown as answers.

I want to get an element is not exist

1 Answer 70 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
liu
Top achievements
Rank 1
liu asked on 19 Jan 2011, 03:59 AM
hi, all
   I want to get an element which is not exist, e.g: app.FindName<Button>("btnAdd"), this button is not exist before I click "add user" link, is there any method can do this? just return "false" if this element can't be found, I always get exception: "System.TimeoutException: Wait for condition has timed out?" thanks very much!

1 Answer, 1 is accepted

Sort by
0
Cody
Telerik team
answered on 21 Jan 2011, 09:43 AM
Hi liu,

Yes, try code similar to this:

Assert.IsNull(ActiveBrowser.Find.ByExpression(new HtmlFindExpression("src=http://col.stb.s-msn.com/i/B7/EB75D45B8948F72EE451223E95A96.gif", "tagname=img")));

Best wishes,
Cody
the Telerik team
Interested in Agile Testing? Check out Telerik TV for a recording of Automated Testing in the Agile Environment
Tags
General Discussions
Asked by
liu
Top achievements
Rank 1
Answers by
Cody
Telerik team
Share this question
or