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

How to Set a Value in Textbox in RadPane

5 Answers 176 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
N1t1nA
Top achievements
Rank 1
N1t1nA asked on 03 May 2011, 06:53 AM

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

Sort by
0
Misho
Telerik team
answered on 03 May 2011, 11:54 AM

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
Do you think you know all the new features coming out in Test Studio R1 2011? Think again - we have some surprises and will share them with you in the What's New in Test Studio R1 2011 Webinar on May 12th.
Register Today!
0
N1t1nA
Top achievements
Rank 1
answered on 04 May 2011, 04:57 AM

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.

0
Accepted
Misho
Telerik team
answered on 05 May 2011, 03:48 PM
Hello Nitin,

    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
Do you think you know all the new features coming out in Test Studio R1 2011? Think again - we have some surprises and will share them with you in the What's New in Test Studio R1 2011 Webinar on May 12th.
Register Today!
0
N1t1nA
Top achievements
Rank 1
answered on 06 May 2011, 05:27 AM
Thankyou Misho

This really helps and Solves the Problem.
0
Konstantin Petkov
Telerik team
answered on 06 May 2011, 07:43 AM
Hello Nitin,

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
Do you think you know all the new features coming out in Test Studio R1 2011? Think again - we have some surprises and will share them with you in the What's New in Test Studio R1 2011 Webinar on May 12th.
Register Today!
Tags
General Discussions
Asked by
N1t1nA
Top achievements
Rank 1
Answers by
Misho
Telerik team
N1t1nA
Top achievements
Rank 1
Konstantin Petkov
Telerik team
Share this question
or