Find and capture the radinput control and its value

9 posts, 0 answers
  1. Priyanka
    Priyanka avatar
    21 posts
    Member since:
    Jan 2013

    Posted 05 Apr 2013 Link to this post

    Hi Telerik team,
    I am using the telerik test studio and have several questions:
    1.How to find the RadInput control and its value.
    2.How to use debugger in coded step directly in test studio Test.

    I'm looking forward for your feedback.
    Thanks.
  2. Plamen
    Admin
    Plamen avatar
    8 posts

    Posted 05 Apr 2013 Link to this post

    Hello Priyanka,

    You can easily locate and create a verification against the RadInput control during recording. Please see this video for a demonstration.

    Regarding your second question, currently it's not possible to debug and set breakpoints in coded steps in Test Studio Standalone. The key to debugging the code in your coded steps is to use Visual Studio's Test View and run the test from there in debug mode. Any break points you set will now cause Visual Studio to stop on that break point letting you debug the source code as needed.

    Regards,
    Plamen
    the Telerik team
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
  3. Priyanka
    Priyanka avatar
    21 posts
    Member since:
    Jan 2013

    Posted 08 Apr 2013 Link to this post

    Thank so much for your reply,
    But i want to find and capture the radinput control and its value in coded step.

    I have written the following coded step:-
     Element e = Find.ById("rtbClinicFileNo");
    System.Windows.Forms.MessageBox.Show(e.Content);

    or 
    RadInput e = Find.ById("rtbClinicFileNo");
    System.Windows.Forms.MessageBox.Show(e.Content);

    but didn't get any value.
    Please help me to solve this problem.

    Thanks
  4. Priyanka
    Priyanka avatar
    21 posts
    Member since:
    Jan 2013

    Posted 08 Apr 2013 Link to this post

    Hi Plamen,

    I found the solution for my first question.
    Firstly, i extract the radinput value and then call the DataBindVariableName of that extract step in object obj= GetExtractedValue("DataBindVariableName"); coded step.

    Thanks
  5. Plamen
    Admin
    Plamen avatar
    8 posts

    Posted 08 Apr 2013 Link to this post

    Hello Priyanka,

    I am glad to hear you were able to resolve this on your own. It seems you found our article on how to Get/Set Extracted Variables in Code. Please contact us again if you have further questions.

    Regards,
    Plamen
    the Telerik team
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
  6. Priyanka
    Priyanka avatar
    21 posts
    Member since:
    Jan 2013

    Posted 18 Apr 2013 Link to this post

    Hi Plamen,

     

    Thank you so much for you guidance,

    Can you please tell me, Is there any other way to capture the rad control value in coded step except using object????/

    Thanks,

  7. Plamen
    Admin
    Plamen avatar
    8 posts

    Posted 19 Apr 2013 Link to this post

    Hi Priyanka,

    You can also capture the value of the RadInput in a string variable. Here's a sample code against this Telerik demo site:
    RadInput input = ActiveBrowser.Find.ById<RadInput>("ctl00_ContentPlaceHolder1_RadTextBox1_wrapper");
    input.TypeText("Test");
     
    //Capture RadInput text into a string variable
    string inputValue = input.TextBoxValue;
    Log.WriteLine(inputValue);


    Kind regards,
    Plamen
    the Telerik team
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
  8. Priyanka
    Priyanka avatar
    21 posts
    Member since:
    Jan 2013

    Posted 22 Apr 2013 Link to this post

    Hi Plamen,

    As you said, i have used same code in my test project but its give me the "Object reference not set to an instance" error.

                RadInput input= ActiveBrowser.Find.ById<RadInput>("rtbPatientFirstName");
                input.TypeText("Priya");
                string inputvalue= input.TextBoxValue;
                Log.WriteLine(inputvalue);
    For your information, i have use developer tools (pressing F12 key) to get the control id.
    Please find the attached images and help me to find the solution.

    Thanks,
  9. Plamen
    Admin
    Plamen avatar
    8 posts

    Posted 24 Apr 2013 Link to this post

    Hello Priyanka,

    I'm sorry to hear you are still having difficulty. In order to help you further with this please record a Fiddler trace using FiddlerCap and send it to us in a zip file. Basically with that trace I'll try to "simulate" your app in order to reproduce the issue and investigate what is happening.

    Regards,
    Plamen
    the Telerik team
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
Back to Top
  Cast Your Vote at DevPro Connections! Cast Your Vote at  Win IT Pro Connections!