Page 1 of 1

Tree.ExpandAll() Does not seem to work

Posted: Tue Jul 21, 2009 6:50 pm
by Ciege
Using Ranorex version: 2.1.0.6243 with DevExpress components.

When I have a valid tree control and I try to use the ExpandAll() method, nothing happens. The tree does not expand and I do not receive any sort of exception. Just nothing.

Re: Tree.ExpandAll() Does not seem to work

Posted: Wed Jul 22, 2009 8:57 am
by Support Team
Hi ciege,
DevExpress are third-party controls and we provide a basic support over MSAA. So it`s possible that some functionality doesn`t work. Although you can use invoke remotly to activate functionality directly from the control. If you use XtraTreeList or something similiar 'invoke remotely' the ExpandAll() method from the tree.

Regards,
Christian
Ranorex Support Team

Re: Tree.ExpandAll() Does not seem to work

Posted: Wed Jul 22, 2009 3:57 pm
by Ciege
Thanks, I'll look into that.

Re: Tree.ExpandAll() Does not seem to work

Posted: Wed Jul 22, 2009 7:20 pm
by Ciege
I'm afraid my limited mastery of C# has me stumped on this one... I am just not sure how to code this up.

Can you help?

Re: Tree.ExpandAll() Does not seem to work

Posted: Thu Jul 23, 2009 9:08 am
by Support Team
Sure! ;)
By the way, there`s an invoke remotely call in the WinformsTestSample (search: SetDateTime).

A short introduction:
FIrst create your delegate method.

e.g.
static object CallExpandAll(System.Windows.Forms.Control control, object input)
{
	(control as DevExpress.XtraTreeList.TreeList).ExpandAll();

	return null;
}
Cast your DevEx TreeView to 'Ranorex.Control' and call 'Invoke Remotely'.

e.g.
Ranorex.Control elementTreeList1 = "/form[@controlname='Form1']/element[@controlname='treeList1']";
			elementTreeList1.InvokeRemotely(CallExpandAll);
Best regards,
Christian
Ranorex Support Team

Re: Tree.ExpandAll() Does not seem to work

Posted: Thu Jul 23, 2009 4:05 pm
by Ciege
Thank you! I will have a look at this and see what I can do with it. I appreciate the help!

Re: Tree.ExpandAll() Does not seem to work

Posted: Thu Jul 23, 2009 5:15 pm
by Ciege
OK, that works great.

One issue though. After I run this code in debug mode, the next time I edit and build my code in VS I fail with an error saying
unable to copy file "obj\Debug\MYTEST.exe" to "bin\Debug\MYTEST.exe"/ The process cannot access the file "bin\Debug\MYTEST.exe" because it is being used by another process.
I need to exit VS and my AUT, then restart both to be able to build again.

How do I debug run this code, then be able to break out of it and clean up. What do I need to do to close the process that is using my .EXE?

Thanks...

Re: Tree.ExpandAll() Does not seem to work

Posted: Mon Jul 27, 2009 10:28 am
by Support Team
Hi,
see recently forum post:
http://www.ranorex.com/forum/compilatio ... lit=invoke

Regards,
Christian
Suppor Team

Re: Tree.ExpandAll() Does not seem to work

Posted: Tue Jul 28, 2009 4:12 pm
by Ciege
Thanks for the info on this. Quite a shame the workaround. When I am testing my code I usually need my AUT in a specific state. If I have to shut it down and reset the state each time it is quite a pain and time consuming.

Re: Tree.ExpandAll() Does not seem to work

Posted: Tue Jul 28, 2009 4:25 pm
by Support Team
I agree, that can be annoying. The problem is that you cannot unload assemblies once they are loaded in a process (except for when they are in a separate AppDomain, but that isn't possible in that case). And your assembly needs to be loaded to be able to invoke the delegate at the automated process.

Once you have finished writing an InvokeRemotely delegate, you should move it to a separate DLL that does not have to be compiled all the time. Sorry, but that's the best workaround I can offer :?

Regards,
Alex
Ranorex Support Team

Re: Tree.ExpandAll() Does not seem to work

Posted: Tue Jul 28, 2009 4:33 pm
by Ciege
Understood, and I am not blaming you (Ranorex)... I'd rather have the pain now of debugging then have the pain of relying on all the lines of code I wrote to do the ExpandAll when just doing the InvokeRemotely works so well.