Selenium and TinyMCE
For many projects, my shop uses TinyMCE for a quick and feature rich WYSIWYG editor. While its simple to implement, it can be awful to automate. Using Selenium type, click, click_at, etc will not work (I suspect because the editor is technically external from the page were testing, see below).
Initially my problem was that I did not allow enough for the page to load before using JS to enter info in to the box. To rectify this, I used time.sleep(5).
Next the issue arose that enterring characters via JS did not register with the character counting mechanism. Since i’m on a time based budget, I can’t spend too much time on this but I figure using os (python) or keypress/keydown in JS will do the trick.
This is the code to use when encountering a TinyMCE box.
Anthony Long :: Jan.07.2010 :: Python, QA, Selenium :: No Comments »