Page 1 of 1

Can I automate a Flash GUI with Ranorex?

Posted: Wed Apr 04, 2007 2:33 pm
by dodel
Hello,

I would like to know if it is possible to automate Flash GUi with ComboBox or others flash native components ?

Thank you,

Do

Posted: Thu Apr 05, 2007 8:20 pm
by webops
Hi Do,

In the following example a flash application running in the IE will be automated. A Radiobutton, Checkbox and Button will be clicked.

1. Open following url in the IE:
http://flash-creations.com/notes/swf/v2 ... _final.swf


2. Finding the browser in a C# Application

Code: Select all

Form form = Application.FindFormTitle("Internet Explorer",SearchMatchMode.MatchSubstring);
if ( form == null )
{
	Console .WriteLine("Cannot find application Internet Explorer"); 
	return 1;
}
form.Activate();
3. Finding the Flash app in the IE

Code: Select all

Element el = form.Element.FindChild(Role.Client, null, "MacromediaFlashPlayerActiveX");
4. Finding Elements(Radiobutton,...) and clicking them

Code: Select all

Element jumpButton = el.FindChild(Role.PushButton, "jump");
Mouse.ClickElement(jumpButton, MouseButtonType.LeftButton, new Point(10, jumpButton.Size.Height / 2), 1, 500);

Element makeSmallerButton = el.FindChild(Role.PushButton, "make smaller");
Mouse.ClickElement(makeSmallerButton, MouseButtonType.LeftButton, new Point(10, 10), 1, 500);

Element doItButton = el.FindChild(Role.PushButton, "Do It");
Mouse.ClickElement(doItButton);
I hope it helps you!
Maybe RanorexRecorder helps you...

Gabor
Ranorex Team

Posted: Wed Apr 11, 2007 9:25 am
by dodel
Hello,

Thank you very much for your help, do you have any ideas to automate click on ComboBox in Flash, to make Ranorex consider them as push button ?

Do

Posted: Wed Apr 11, 2007 6:57 pm
by webops
Hi,

To click on elements of a ComboBox you have to drop it down first. After that the elements are "visible" and you can find them.

You have to navigate with the TAB key to the ComboBox and press CTRL + DOWN to drop it down. I'm sorry but i think this is the only way to drop down a flash ComboBox.

1. Open the same sample flash application as described above

2. Find the Flash app in the IE and navigate to the ComboBox

Code: Select all

Control flash = form.FindClassName("MacromediaFlashPlayerActiveX");
flash.Focus();
flash.SendKeys("{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}^{DOWN}");
3. Find and click on a ComboBox element

Code: Select all

Application.Sleep(200);
Element johnButton = flash.Element.FindChild(Role.PushButton, "John");
Mouse.ClickElement(johnButton);
Hope it helps!

Gabor
Ranorex Team

Posted: Tue Jul 01, 2008 2:10 pm
by Gendal67
Hi everyone,

It's the first time, I heard about "Ranorex". I read on Wikipedia that's a Windows GUI to make software developpement easier.
I'm ready to install and test it if it can help me.

Could you say me if it's possible to register and handle Flash events ?
Is it possible to cast or "transform" the flash "Element" to an object of type 'ShockwaveFlash' (.NET object, provided by Adobe) ?
If I can get this object, I can then register to flash events...

I hope someone will respond and help me please :)

Cheers,
Jack, FRANCE

Posted: Mon Jul 07, 2008 3:02 pm
by Support Team
Jack,

Unfortunately, this is not possible at the moment.

The upcoming Ranorex 2.0 will have support for flash/flex testing.

Michael
Ranorex Team