NullReferenceException on coded HtmlControl find

3 posts, 0 answers
  1. Bret
    Bret avatar
    2 posts
    Member since:
    Apr 2016

    Posted 13 Apr 2016 Link to this post


    I receive the error "System.NullReferenceException: Object reference not set to an instance of an object." on a coded step that logs a user out of web application in step 5, and then waits until the "thank you" text is displayed on the subsequent page until continuing with the script. The error is thrown on line 8. I construct the ThankYouSignOut object in line 7 almost exactly the same as the SignOutLink in step 2, so I'm at a loss as to why it's passing on step 2-5, but failing on 8. Any help would be appreciated!


    2.Dim SignOutLink AS HtmlAnchor = ActiveBrowser.Find.ByExpression(Of HtmlAnchor)(new HtmlFindExpression("tagname=a", "href=~logout"))
    7.Dim ThankYouSignOut AS HtmlControl = ActiveBrowser.Find.ByExpression(Of HtmlControl)(new HtmlFindExpression("tagname=p","TextContent=^Thank you for using"))


  2. Bret
    Bret avatar
    2 posts
    Member since:
    Apr 2016

    Posted 14 Apr 2016 in reply to Bret Link to this post

    Nevermind. Of course as soon as I post to the forum I find the answer to my question.


  3. Boyan Boev
    Boyan Boev avatar
    1072 posts

    Posted 15 Apr 2016 Link to this post

    Hi Bret,

    Happy to hear that!

    If you need further assistance please let us know.

    Boyan Boev
    The New Release of Telerik Test Studio Is Here! Download, install,
    and send us your feedback!
Back to Top