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
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
0
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
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
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
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
Hello Chaitanya,
Here is a video demonstration.
Let me know if this helps.
Regards,
Boyan Boev
Telerik
Here is a video demonstration.
Let me know if this helps.
Regards,
Boyan Boev
Telerik
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
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
SO can you please tell me how can this step achevied using telerik either by code or any setting
0
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:
Hope this helps.
Regards,
Boyan Boev
Telerik
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
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
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
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 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