I want to get an element is not exist

2 posts, 0 answers
  1. liu
    liu avatar
    4 posts
    Member since:
    Oct 2010

    Posted 18 Jan 2011 Link to this post

    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!
  2. Cody
    Admin
    Cody avatar
    3354 posts

    Posted 21 Jan 2011 Link to this post

    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
Back to Top