1

There is a form in a flash application that I would like to fill out automatically. I did a search, and found this:

Key Presses in Python

That works fine for notepad and such, but how do I grab a flash object running in FireFox, simulate pressing characters, and also simulate pressing ENTER for moving to the next field?

EDIT

Actually, do you even need to grab the flash object in the first place? Why not just simulate the keypresses directly?

Anyways, if it helps any...

Windows 7 Home Edition, Python 2.4

Community
  • 1
  • 1
Entity
  • 7,972
  • 21
  • 79
  • 122
  • I would be interested to know if this was possible. I would guess you would need to hack/decomplie the swf to do it? – eat_a_lemon May 04 '11 at 20:28
  • 1
    This guy did something similar. Mathletics is a flash game: http://www.importsoul.net/category/python/thinkquick/ – Entity May 04 '11 at 20:30
  • Thanks for the little shout out, when i wrote the program i also made a few changes to it to make it simpler to use but i dont know where that code has gone – Hugoagogo Aug 05 '11 at 10:33

2 Answers2

1

This works perfectly: http://www.rutherfurd.net/python/sendkeys

Entity
  • 7,972
  • 21
  • 79
  • 122
0

This is possible via the Selenium testing framework with a special Flash extension for letting selenium talk to Flash in the browser. The Python client is in the downloads section.

Here is an article walking through an example (the sample client code is in Java, but should also work with the Python client).

samplebias
  • 37,113
  • 6
  • 107
  • 103