0

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.

4

1 回答 1

0

使用 TinyMCE,编辑器区域实际上不是 TextArea - 它是 IFrame。您最好的选择是使用 Google Chrome(或类似的,具有面向开发人员的功能)来查看 TMCE 生成的内容。然后,您可以将 XPath 与以下内容一起使用:

//IFRAME

这将检索页面上的所有 IFRAME - 或者您可以添加属性:

//IFRAME[id="myiframe"]

这将检索页面上 ID 属性设置为“myiframe”的所有 IFRAME

希望这可以帮助 :)

于 2009-09-17T23:10:41.073 回答