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

Perform click action on the HTML button Control

8 Answers 217 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Chaitanya
Top achievements
Rank 1
Chaitanya asked on 19 May 2014, 07:37 AM
Hi Team,

Need help in clicking an htmlbutton control in my test.

Here is the scenario.

I have an student Information access application, I need to upload the student information from an excel sheet and then in the UI I will see all the student names as buttons . for example if i upload 10 students info i will see 10 buttons in the application.

So if i click on the button it will redirect me to details page.

In this case i have reocrded the step for one student (clicking onthe button and in the details page doing some validation), now i want to use the same test for all the uploaded all students.

since here my need is to click all the 10 buttons and validate the details, how would my recording for one student click will suffice the entire scenatro (since each and every button has same control id but the tag index property is on incremental bases)


How would my test know to click 2nd button till 10 th button during run time.?

Thanks & Regards
G.Chaitanya 







8 Answers, 1 is accepted

Sort by
0
Boyan Boev
Telerik team
answered on 19 May 2014, 11:05 AM
Hi Chaitnya,

Thank you for contacting us.

To achieve your scenario you should use DataDrivenFindExpression.

You can bind the find rules of the button to the Excel sheet.

Let me know if this helps.

Regards,
Boyan Boev
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Chaitanya
Top achievements
Rank 1
answered on 20 May 2014, 08:23 AM
Thanks for your quick response.

Do you have any example videos to demonistrate this DataDrivenFindExpression scenario ?

If yes can you please post that video link for me

Regards
G.Chaitanya
0
Boyan Boev
Telerik team
answered on 20 May 2014, 10:25 AM
Hello Chaitanya,

Here is a video demonstration.

Let me know if this helps.

Regards,
Boyan Boev
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Chaitanya
Top achievements
Rank 1
answered on 22 May 2014, 12:53 AM
Thanks for your reply,

But Based on the Button controls i have in the UI i need to iterate each one based on the tag index i need to click them and proceed further, DO we have any setting to perform click action using the loop by incrementing the tag index.

Or do we need to write code to perform the action ? If yes can you please provide the nessacary setting or code for the same.

Regards
G.Chaitanya
0
Chaitanya
Top achievements
Rank 1
answered on 22 May 2014, 08:33 AM
The ask here is based on the number of buttons present in the UI, I need to iterate each button ( the change on each button is the ID is same but the Tagindex is incrementing) and click on the button to perform some validation

SO can you please tell me how can this step achevied using telerik either by code or any setting
0
Boyan Boev
Telerik team
answered on 26 May 2014, 10:58 AM
Hi Chaitanya,

The fastest way is to create a coded step which will collect all buttons in a collection and then via a loop you can click on each of them. Let's say every student is link, here is a sample code:

IList<HtmlInputButton> buttonList = ActiveBrowser.Find.AllByExpression<HtmlInputButton>("type=button");

foreach (HtmlInputButton item in buttonList)
            {
                item.Click();
            }

Hope this helps.

Regards,
Boyan Boev
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Chaitanya
Top achievements
Rank 1
answered on 10 Jun 2014, 03:38 AM
Thanks For the Code Snippet.

Is there any feature/setting in the telerik test studio which will auto increment the tag index and perform button click action using the ID.

This needs to be done not using by code. Can you please let me know how this can be possible  using sample recording.

Thanks
Chaitanya
0
Boyan Boev
Telerik team
answered on 12 Jun 2014, 08:29 AM
Hi Chaitanya,

The only way without using code is to use a data source. There you can put the increasing TagIndex and data bind the find expression of the element. 

However with that approach the entire test will execute as many times as are the rows in the data source.

Let me know if this helps.

Regards,
Boyan Boev
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
Tags
General Discussions
Asked by
Chaitanya
Top achievements
Rank 1
Answers by
Boyan Boev
Telerik team
Chaitanya
Top achievements
Rank 1
Share this question
or