- Home
- Forum
- Xamarin.Forms
- SfListView.ItemTemplate does not generate AutomationId at runtime.
SfListView.ItemTemplate does not generate AutomationId at runtime.
My code sets AutomationId for tags below:
- SfListView
- SfListView.ItemTemplate
- Control under DataTemplate
and I would like to use these AutomationId for the automate testing (e.g. Selenium).
The AutomationId in tag SfListView and control under DataTemplate are available (see my attachment, file 1.png and 3.png),
but the AutomationId in tag SfListView.ItemTemplate is unavailable at runtime (see 2.png in the attachment).
How to make AutomationId is available at SfListView.ItemTemplate level?
However, I would not to set AutomationId at the control under DataTemplate everytimes that I use SfListView.
and I would like to create my control that inherits from SfListView, pre-set some properties (ex. AutomationId, ...) and use my control in the solution insteadly.
Best regards,
Gai
Attachment: SfPlayground_c1a3373.zip
SIGN IN To post a reply.
3 Replies
RS
Rawoof Sharief Muthuja Sherif
Syncfusion Team
April 6, 2018 10:02 AM UTC
Hi Krurkrit,
We have checked the reported query “ItemTemplate does not generated AutomationId” from our end. We would like to let you know that the automation id of Grid inside the ItemTemplate is the item level automation id. You can use the automation id for the grid instead of ItemTemplate. Can you please state the purpose of using automation id for the ItemTemplate.
Please let us know if you require further assistance.
Regards,
Rawoof M.
KP
Krurkrit Phoosakul
April 9, 2018 03:23 AM UTC
The purpose is I would like to use automation id for automate testing.
Currently, I use Selenium and need to find row by automation id to verify data in each row.
Currently, I use Selenium and need to find row by automation id to verify data in each row.
Due to several pages on my project that use SfListView, it use the same pattern, if I can set automation id to SfListView.ItemTemplate, it would be helpful.
The grid that you mention, you mean SfDataGrid, right?
RS
Rawoof Sharief Muthuja Sherif
Syncfusion Team
April 9, 2018 11:21 AM UTC
Hi Krurkrit,
Thanks for the update.
Query 1: The grid that you mention is SfDataGrid.
In our earlier update, we have mentioned that the Xamarin Forms Grid represents the parent element in the ItemTemplate of your project.
Query 2: How can I set Automation id to ItemTemplate
You can set the Automation id for the parent element in the ItemTemplate of your project which is equal to the Automation id of the ItemTemplate.
Please let us know if you require further assistance.
Regards,
Rawoof M.
SIGN IN To post a reply.
- 3 Replies
- 2 Participants
-
KP Krurkrit Phoosakul
- Apr 5, 2018 05:54 AM UTC
- Apr 9, 2018 11:21 AM UTC