This is a migrated thread and some comments may be shown as answers.

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

1 Answer 104 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 2
John asked on 09 Jan 2012, 10:06 PM
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

1 Answer, 1 is accepted

Sort by
0
Anthony
Telerik team
answered on 09 Jan 2012, 10:38 PM
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.
Tags
General Discussions
Asked by
John
Top achievements
Rank 2
Answers by
Anthony
Telerik team
Share this question
or