Tree.ExpandAll() Does not seem to work

Bug reports.
User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Tree.ExpandAll() Does not seem to work

Post by Ciege » Tue Jul 21, 2009 6:50 pm

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.
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

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

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

Post by Support Team » Wed Jul 22, 2009 8:57 am

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
.
Image

User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

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

Post by Ciege » Wed Jul 22, 2009 3:57 pm

Thanks, I'll look into that.
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

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

Post by Ciege » Wed Jul 22, 2009 7:20 pm

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?
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

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

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

Post by Support Team » Thu Jul 23, 2009 9:08 am

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
.
Image

User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

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

Post by Ciege » Thu Jul 23, 2009 4:05 pm

Thank you! I will have a look at this and see what I can do with it. I appreciate the help!
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

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

Post by Ciege » Thu Jul 23, 2009 5:15 pm

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...
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

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

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

Post by Support Team » Mon Jul 27, 2009 10:28 am

Hi,
see recently forum post:
http://www.ranorex.com/forum/compilatio ... lit=invoke

Regards,
Christian
Suppor Team
.
Image

User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

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

Post by Ciege » Tue Jul 28, 2009 4:12 pm

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.
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

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

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

Post by Support Team » Tue Jul 28, 2009 4:25 pm

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
.
Image

User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

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

Post by Ciege » Tue Jul 28, 2009 4:33 pm

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.
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...