views:

184

answers:

1

I've looked all over but I can't find any leads. Is it possible to do something like:

//textarea/<some kind of function?>

or

<function>(//textarea)

I know I can do this using JS, or any number of other techniques, but I'm asking because I'm using WebDriver and Firefox to test a TinyMCE textarea input, and because of JS execution delays, I'd like to wait for the textarea to display a certain string after clicking a formatting control and the only way I can think of to achieve this in WebDriver is with SlowLoadableComponent and XPath. That or Thread.sleep but I'd like to avoid that ;)

Thanks in advance.

A: 

With TinyMCE, the editor area isn't actually a TextArea - it's an IFrame. Your best bet would be to use Google Chrome (or similar, with Developer-targeted features) to have a look at what TMCE generates. You can then use XPath with something like this:

//IFRAME

which will retrieve all IFRAMEs on the page - or you can add in properties:

//IFRAME[id="myiframe"]

which will retrieve all IFRAMEs on the page with the ID attribute set to 'myiframe'

Hope this helps :)

Fritz H