How to refer to an element that doesn't exist

3 posts, 1 answers
  1. Cheryl
    Cheryl avatar
    45 posts
    Member since:
    Jul 2006

    Posted 09 Aug 2011 Link to this post

    Hello

    I have a login page.  If the login fails then an error message is displayed, otherwise the user is taken into the website.
    I wanted to try an If else statement, and check if the error message is visible and if not then assume success and continue into the website.

    However, if the login is successful, the error message label is not visible (and does not exist in the html code) and therefore the test fails with an unable to locate element error.

    Unable to locate element. Details: Attempting to find [Html] element using Find logic (Html): [id 'Exact' ctl00_ContentPlaceHolder1_lblmessage] AND [tagname 'Exact' span]


    Any suggestions?

    Thanks
  2. Answer
    Plamen
    Admin
    Plamen avatar
    8 posts

    Posted 10 Aug 2011 Link to this post

    Hello Cheryl,

    I'm sorry you are experiencing this problem. I've been able to reproduce it and I've logged it as a bug. You can track its progress in our PITS system here.

    It appears that when we use Wait.ForVisible in "if..else" statement Test Studio fires an error. Meanwhile you can use Wait.ForExists method until the problem is solved. 

    Hope to here from you soon!

    Best wishes,
    Plamen
    the Telerik team
    Vote for Telerik Test Studio at the Annual Automation Honors Voting!
  3. Cheryl
    Cheryl avatar
    45 posts
    Member since:
    Jul 2006

    Posted 14 Aug 2011 Link to this post

    Ok, thanks Plamen
Back to Top