Checking to see if a control exists or not

3 posts, 0 answers
  1. Talal
    Talal avatar
    19 posts
    Member since:
    Jan 2012

    Posted 15 Feb 2012 Link to this post

    Hi Guys,

    I have a situation where a textblock is created whose name is either 'TrueTextBlock' or 'FalseTextBlock'. Ignoring the fact it's quite a poor idea to change the name of a textblock based on the text content is there a way I can do something like this:

    if(Pages.HardCatNextGen.SilverlightApp.FalseTextblock.Wait.ForExists(1000))


    Where ForExists returns 'true' if FalseTextBlock exists and 'false' if FalseTextBlock does not exist.

    ForExists works to check if a control exists (correct me if I'm wrong), however it doesn't return a true or false value if the control in question exists or doesn't.

    Is there such a function I could leverage to do what I want?

    Cheers
  2. Talal
    Talal avatar
    19 posts
    Member since:
    Jan 2012

    Posted 17 Feb 2012 Link to this post

    [bump]

    Anyone have any ideas?
  3. Cody
    Admin
    Cody avatar
    3354 posts

    Posted 17 Feb 2012 Link to this post

    Hi Talal,
    I admit this is a bit tricky. Check out the following article:
    http://www.telerik.com/automated-testing-tools/support/documentation/user-guide/code-samples/general/wait-for-element-to-exist-in-code.aspx

    Near the bottom of the page you'll find Silverlight-specific info.


    All the best,
    Cody
    the Telerik team
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
Back to Top