Select last row in a table

Ask general questions here.
anujakulkarni
Posts: 29
Joined: Wed Jan 07, 2009 1:15 pm

Select last row in a table

Post by anujakulkarni » Tue Mar 03, 2009 3:59 pm

Hi,

I am using C# and my testcase requires me to always select the last row in a table.

Can anyone suggest how I can do the same?

Cheers,

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Post by Support Team » Tue Mar 03, 2009 6:18 pm

Could you give us more information about the control that you want to automate(WinForms, WPF, MSAA...)


Regards,
Christian,
RAnorex Support Team

anujakulkarni
Posts: 29
Joined: Wed Jan 07, 2009 1:15 pm

Post by anujakulkarni » Wed Mar 04, 2009 11:40 am

Hi Christian,

Following are the details of the UIAutomation section in the "Detail" tab as recorded by Ranorex Spy.

- ClassName = ListView
- ControlType = DataGrid
- FrameworkId = WPF
- IsContentElement = True
- IsControlElement = True
- IsKeyboardFocusable = True
- IsPassword = False
- IsRequiredForForm = False
- LocalizedControlType = datagrid

Hopefully this helps :)

Cheers,

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Post by Support Team » Thu Mar 05, 2009 1:41 pm

You can use the index of the last row like

Code: Select all

tableListView.Rows[tableListView.Rows.Count-1]
Regards,
Christian,
Ranorex Support Team

anujakulkarni
Posts: 29
Joined: Wed Jan 07, 2009 1:15 pm

Post by anujakulkarni » Tue Mar 10, 2009 12:39 pm

Thanks Christian :)