Last week I worked on some integration tests in Selenium. Today I’m redoing the same test in WatiN to get a feel for both tools.
Since the application uses TinyMCE for most of it’s text inputs I had to find a way to write to it within the tests. With Selenium Nick Bartlett had a solution. For WatiN I used the Eval method and executed the setContent JavaScript method in the TinyMCE API.
var js = "tinyMCE.get('tinyTextAreaId').setContent('some html');";
var s = Document.Eval(js);
This would work just as good with Selenium and it has one advantage over setting the text areas. It executes the eventual cleanup rules in TinyMCE before it sets the text.
5 thoughts on “Write to TinyMCE in a WatiN integration test”
Warning: call_user_func() expects parameter 1 to be a valid callback, function 'twentyeleven_comment' not found or invalid function name in /customers/3/e/0/olalindberg.com/httpd.www/wp-includes/comment-template.php on line 1334 Warning: call_user_func() expects parameter 1 to be a valid callback, function 'twentyeleven_comment' not found or invalid function name in /customers/3/e/0/olalindberg.com/httpd.www/wp-includes/comment-template.php on line 1334 Warning: call_user_func() expects parameter 1 to be a valid callback, function 'twentyeleven_comment' not found or invalid function name in /customers/3/e/0/olalindberg.com/httpd.www/wp-includes/comment-template.php on line 1334 Warning: call_user_func() expects parameter 1 to be a valid callback, function 'twentyeleven_comment' not found or invalid function name in /customers/3/e/0/olalindberg.com/httpd.www/wp-includes/comment-template.php on line 1334 Warning: call_user_func() expects parameter 1 to be a valid callback, function 'twentyeleven_comment' not found or invalid function name in /customers/3/e/0/olalindberg.com/httpd.www/wp-includes/comment-template.php on line 1334