views:

124

answers:

2

I written a C# tool that simulates a user interacting with a Windows 7 environment. It works except when interacting with a couple online flash applications. Mouse movements and clicks are being generated, but the Flash apps do not receive them. I am thinking I need to generate lower-level mouse events, but cannot confirm this.

I have tried a couple different mechanisms:

[DllImport("user32.dll")]
static extern void mouse_event(int dwFlags, int dx, int dy, int dwData, int dwExtraInfo);

[DllImport("user32.dll", SetLastError = true)]
private static extern uint SendInput(uint nInputs, INPUT[] pInputs, int cbSize);

Has anyone come across this problem? Any ideas how I can generate mouse events that would register with a Flash app?

Update: It looks like the flash apps are receiving the mouse click. Their click animations are presented when a mouse click is submitted by the C# app. Still, nothing happens even though the Flash app's mouse click animation displayed.

A: 

Have you investigated FlexMonkey for Flex/AIR UI testing? We've had some success with that. http://www.gorillalogic.com/flexmonkey

Chad Udell
A: 

Different flash apps respond to different mouse_events. Have you tried sending mousedown, mouseup, etc? Also, sometimes you will need to use mousemove first. I've seen some flash apps where some buttons work by mousedown and others by mouseup. Also consider disabling the keyboard and mouse just before sending the events and re-enabling after.

Eyal