Checked attribute and method of TreeItem

Ranorex Spy, Recorder, and Studio.
christof
Posts: 19
Joined: Thu Feb 18, 2010 10:58 am

Checked attribute and method of TreeItem

Post by christof » Thu Feb 18, 2010 11:57 am

Hi.

Just wondering whether anybody could shed come light on a problem that I am having with a set of TreeItems within a TreeList.
I have a simple trivial method that is supposed to just display a MessageBox or return a bool depending on whether the TreeList item is Checked or not. So, I am testing the Checked attribute - problem is, no matter what state the gui control is in (be it checked or not checked) it always returns/or displays false.
As far as I understand it from the developers, that this is a standard .NET control and there should be nothing unusual about it. Also, if you inspect the control using the Ranorex Spy tool, it seems that there is only two attributes in AccessibleState namley Expanded and Selectable; although the control appears to have the Checked attribute under the TreeItem details.
The code for the method is below and attached is the snapshot of the TreeList and sub-TreeItems.
public static void isCategoryVariableChecked(String var)
		{
			foreach(TreeItem t in getListOfCategoryVariables())
			{
				if(t.Text==var && t.Checked)
				{
					MessageBox.Show(t.Checked.ToString());
				}
			}
		}
If anybody has any ideas that would be appreciated.

C
Attachments
snapshot.rxsnp
(123.79 KiB) Downloaded 216 times

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

Re: Checked attribute and method of TreeItem

Post by Support Team » Thu Feb 18, 2010 4:46 pm

Hi,

I'm sorry but it it seems that your tree control is not a standard .NET tree control. Could it be that the checkbox states are presented by simple images?

The only thing we can offer with that type of tree node items is, to use the Ranorex invoke mechanism. With that you're able to request the state of a tree node directly by using the control adapter as described with our Ranorex Studio sample project 'Win Forms Test' (method name: TestCalendar() in WinFormsTest.UserCode.cs)
What your developers need to do is only to provide a methode which returns the checked state of a given tree item.

I'm sorry, but also accessibility extension is not that easy to implement for that type of tree node you're using.

best regards,

Christoph,
Ranorex Support Team
.
Image

christof
Posts: 19
Joined: Thu Feb 18, 2010 10:58 am

Re: Checked attribute and method of TreeItem

Post by christof » Thu Feb 18, 2010 5:07 pm

Thanks for the info.

C