Hi
My Application contains Textbox in RadPane,
Telerik.WebAii.Controls.Html.
RadPane TxtFirstName = Find.ById<Telerik.WebAii.Controls.Html.RadPane>("ctl00_Contentplaceholder_FirstNameTextBox");
I want to Input a value Using Coded Step
How to use this.
5 Answers, 1 is accepted
Hello Nitin,
I’m sending you a short example of how to set a certain value to a text box using a coded step.
Let’s assume you have a page containing a textbox inside a RadPane similar to the following:
<
telerik:RadSplitter
id
=
"RadSplitter1"
runat
=
"server"
width
=
"700"
height
=
"300"
>
<
telerik:RadPane
id
=
"RadPane1"
runat
=
"server"
>
<
div
>RadPane</
div
>
<
label
for
=
"TextBox1"
>TextBox</
label
>
<
input
type
=
"text"
id
=
"TextBox1"
/>
</
telerik:RadPane
>
</
telerik:RadSplitter
>
In order to input a value in the textbox it’s necessary to perform coded steps in the test similar to the following:
HtmlInputText textbox = Find.ById("TextBox1").As<
HtmlInputText
>();
textbox.Value = "Input Text";
I hope this helps.
Kind regards,
Misho
the Telerik team
Register Today!
Thankyou for Reply
But in My Application when i try to Recognize text box (Firstname) by using Add To Project Elements It is recognized as a RadPane. showing Control Type as Telerik.WebAii.Controls.Html.RadPane.
public Telerik.WebAii.Controls.Html.RadPane ContentplaceholderFirstNameTextBoxText
{
get
{
return Get<Telerik.WebAii.Controls.Html.RadPane>("id=ctl00_Contentplaceholder_FirstNameTextBox", "tagname=input");
}
}
Now what I want is to Enter Value in Firstname Textbox through Coded Step
I tried by using this Code
Telerik.WebAii.Controls.Html.RadPane TxtFirstName = Find.ById<Telerik.WebAii.Controls.Html.RadPane>("ctl00_Contentplaceholder_FirstNameTextBox" );
but it does not display TxtFirstName.Value ??
Please Help How I enter value in FirstName Textbox.
The textbox Control Type inside a RadPane actually might be recognized as “ArtOfTest.WebAii.Controls.HtmlControls.HtmlInputText” but not as “Telerik.WebAii.Controls.Html.RadPane”.
In order to work around this issue you need to stop the RadSplitterTranslator in the following way:
1. Open the TestStudio and navigate to project settings- see the attached screenshot;
2. Select “Translators” from the list;
3. Uncheck the “RadSplitter for ASP.NET AJAX Translator”;
The textbox in a coded test might be found and set with value using a code similar to:
ArtOfTest.WebAii.Controls.HtmlControls.HtmlInputText TxtFirstName =
Find.ById<
ArtOfTest.WebAii.Controls.HtmlControls.HtmlInputText
>("ctl00_Contentplaceholder_FirstNameTextBox"
);
TxtFirstName.Value = “Input Text”;
Thanks for your report. I hope this will solve your issue.
Best wishes,
Misho
the Telerik team
Register Today!
This really helps and Solves the Problem.
We're glad that solves the problem.
This is a quick follow-up to let you know the issue is fixed in the product. The solution will get live with the next internal build of Test Studio.
I have updated your Telerik points as a small token of gratitude for your feedback, thank you!
Kind regards,
Konstantin Petkov
the Telerik team
Register Today!