Is it possible to unit test the MS AJAX Control Toolkit's HTML Editor? I've tried Watin, WebAii and Selenium without any success...
Watin
I can find the textbox related to the control but I get an exception trying to access it:
using (Browser ie = new IE()) {
ie.GoTo(testUri);
Assert.IsTrue(ie.ContainsText("Expected text"));
var textBox = ie.TextField(Find.ById(id => id.Contains("Editor")));
textBox.TypeText("testing 123");
}
System.Runtime.InteropServices.COMException: Can't move focus to the control because it is invisible, not enabled, or of a type that does not accept the focus.
Selenium
I tried the Selenium IDE also without any success. When I loaded ASP.net's sample page, typed some text into the editor and clicked the "Submit" button here is the test case it made:
[Test]
public void TheUntitledTest() {
selenium.Open("/AJAX/AjaxControlToolkit/Samples/HTMLEditor/HTMLEditor.aspx");
// Text was typed at this point
selenium.Click("ctl00_SampleContent_submit");
}
Here is the log messages from rerunning the recorded actions in the Selenium IDE:
[info] Executing: |open | /AJAX/AjaxControlToolkit/Samples/HTMLEditor/HTMLEditor.aspx | |
[info] Executing: |click | ctl00_SampleContent_submit | |