How to Set a Value in Textbox in RadPane

6 posts, 1 answers
  1. N1t1nA
    N1t1nA avatar
    37 posts
    Member since:
    Mar 2011

    Posted 03 May 2011 Link to this post

    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.

     

  2. Misho
    Admin
    Misho avatar
    129 posts

    Posted 03 May 2011 Link to this post

    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!
  3. N1t1nA
    N1t1nA avatar
    37 posts
    Member since:
    Mar 2011

    Posted 03 May 2011 Link to this post

    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.

  4. Answer
    Misho
    Admin
    Misho avatar
    129 posts

    Posted 05 May 2011 Link to this post

    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!
  5. N1t1nA
    N1t1nA avatar
    37 posts
    Member since:
    Mar 2011

    Posted 06 May 2011 Link to this post

    Thankyou Misho

    This really helps and Solves the Problem.
  6. Konstantin Petkov
    Admin
    Konstantin Petkov avatar
    1911 posts

    Posted 06 May 2011 Link to this post

    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!
Back to Top
  Cast Your Vote at DevPro Connections! Cast Your Vote at  Win IT Pro Connections!