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

Find and capture the radinput control and its value

8 Answers 48 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.
Priyanka
Top achievements
Rank 1
Priyanka asked on 05 Apr 2013, 06:15 AM
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.

8 Answers, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 05 Apr 2013, 07:41 AM
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
0
Priyanka
Top achievements
Rank 1
answered on 08 Apr 2013, 05:53 AM
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
0
Priyanka
Top achievements
Rank 1
answered on 08 Apr 2013, 07:00 AM
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
0
Plamen
Telerik team
answered on 08 Apr 2013, 10:07 AM
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
0
Priyanka
Top achievements
Rank 1
answered on 18 Apr 2013, 12:32 PM
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,

0
Plamen
Telerik team
answered on 19 Apr 2013, 02:49 PM
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
0
Priyanka
Top achievements
Rank 1
answered on 22 Apr 2013, 06:33 AM
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,
0
Plamen
Telerik team
answered on 24 Apr 2013, 09:29 AM
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
Tags
General Discussions
Asked by
Priyanka
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Priyanka
Top achievements
Rank 1
Share this question
or