Hello forum users,
I have a problem, to find a button via id on my page. The button has the id "test" and is surrounded by a section with the id "testform".
If I try to find my button with
I get null.
If I try
I get the surrounding section instead of the button. Very annoying.
It seems, that the Find.ById makes no exact search, but searches with contains, so that the first element, that contains my search text is found. It makes no different, if my form id is "testform" or "formtest"
My Form:
PS: I'm using MVC 4.0 with razor syntax and .NET 4.0, VS 2010 Professional SP1, Telerik Testing Framework 2013.2
Greetings
Thomas
I have a problem, to find a button via id on my page. The button has the id "test" and is surrounded by a section with the id "testform".
If I try to find my button with
HtmlInputSubmit myButton = Find.ById<
HtmlInputSubmit
> ("test");
I get null.
If I try
Element myButton = Find.ById ("test");
I get the surrounding section instead of the button. Very annoying.
It seems, that the Find.ById makes no exact search, but searches with contains, so that the first element, that contains my search text is found. It makes no different, if my form id is "testform" or "formtest"
My Form:
<
section
id
=
"testform"
>
<
h2
>Headline</
h2
>
@using (Html.BeginForm(new { ReturnUrl = ViewBag.ReturnUrl }))
{
<
input
type
=
"submit"
class
=
"k-button"
value
=
"Click me"
id
=
"test"
/>
}
</
section
>
PS: I'm using MVC 4.0 with razor syntax and .NET 4.0, VS 2010 Professional SP1, Telerik Testing Framework 2013.2
Greetings
Thomas