threw exception on Object reference not set to an instance of an object.

2 posts, 0 answers
  1. John
    John avatar
    8 posts
    Member since:
    Jul 2012

    Posted 09 Jan 2012 Link to this post

    I see the following error:

    Test method TracerStuff.TracerStuff.WebTest1UnitTest.SampleWebAiiTest threw exception:
    System.NullReferenceException: Object reference not set to an instance of an object.

    <TestMethod()> _
    Public Sub SampleWebAiiTest()
        ' Launch a browser instance
        Manager.LaunchNewBrowser(BrowserType.InternetExplorer)
     
        ' The active browser
        ActiveBrowser.NavigateTo("http://www.google.com")
     
        ' Find the google search box and set it to "ArtOfTest";
        Find.ByName(Of HtmlInputText)("q").Text = "ArtOfTest"
     
        ' Click the Search button
        Find.ByName(Of HtmlInputSubmit)("btnG").Click()
     
        ' Validate the search contain the 'ArtOfTest' text
        Assert.IsTrue(ActiveBrowser.ContainsText("ArtOfTest"))
    End Sub


    Any idea's?

    John
  2. Anthony
    Admin
    Anthony avatar
    19 posts

    Posted 09 Jan 2012 Link to this post

    Hello John,

    Google recently changed the name of their Submit button. Change that line to the following:

    Find.ByName(Of HtmlInputSubmit)("btnK").Click()

    Greetings,
    Anthony
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top