
var ed2 = Find.ByCustom<Telerik.WebAii.Controls.Html.RadEditor>(a => a.ID.EndsWith("MqTelerikEditor"));
Assert.IsNotNull(ed2, "Did not find the editor");
const string html = "Test Code";
ed2.Html = html;
This test fails on the last line with this exception and stack dump.
ArtOfTest.WebAii.Exceptions.ExecuteCommandException : ExecuteCommand failed!
InError set by the client. Client Error:
System.InvalidOperationException: Javascript call [$find(\'ctl00_cContent_ctl00_MqTelerikEditor\').set_html(\'Test Code\')] failed! Please make the function exists and the call is using the correct prototype signature. Javascript error: [object Error]
at ArtOfTest.InternetExplorer.IECommandProcessor.InvokeFunction(String functionCall, Boolean useEval, Boolean returnJSON)
at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessActionCommands(BrowserCommand request)
at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessCommand(WebBrowserClass ieInstance, BrowserCommand request, IHTMLDocument2 document)
BrowserCommand (Type:'Action',Info:'NotSet',Action:'InvokeJsFunction',Target:'ElementId (tagName: '',occurrenceIndex: '-1')',Data:'$find(\'ctl00_cContent_ctl00_MqTelerikEditor\').set_html(\'Test Code\')',ClientId:'Client_0f07abc3-99d2-47b2-aa1e-aa5d60203816',HasFrames:'False',FramesInfo:'',TargetFrameIndex:'-1',InError:'True',Response:'System.InvalidOperationException: Javascript call [$find(\'ctl00_cContent_ctl00_MqTelerikEditor\').set_html(\'Test Code\')] failed! Please make the function exists and the call is using the correct prototype signature. Javascript error: [object Error]
at ArtOfTest.InternetExplorer.IECommandProcessor.InvokeFunction(String functionCall, Boolean useEval, Boolean returnJSON)
at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessActionCommands(BrowserCommand request)
at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessCommand(WebBrowserClass ieInstance, BrowserCommand request, IHTMLDocument2 document)')
InnerException: none.
I am guessing there is a miss match with the Translator and that I need a 2010.2 version. Is this due?
When I watch the test run I see the content of the Editor does take the new content just before it crashes out.
John.
9 Answers, 1 is accepted
I believe the problem is that you're using a var for your ed2 variable instead of a RadEditor type. Please use this line of code instead:
Dim
ed2
As
RadEditor = Find.ByCustom<Telerik.WebAii.Controls.Html.RadEditor>(a => a.ID.EndsWith(
"MqTelerikEditor"
));
Kind regards,
Cody
the Telerik team

var in C# is a strongly typed object.
RadEditor ed2 = Find.ByCustom<
Telerik.WebAii.Controls.Html.RadEditor
>(a => a.ID.EndsWith("MqTelerikEditor"));
As far I can see from the posted error, RadEditor's client-side object is not initialized. Did you make an Ajax call in one of the previous test steps?
Could you please provide us with the full test code and a live url to the page you tested? In case that you are unable to provide a live url, please send us the page's code.
I created a simple test(similar to the code you sent), which is executed over the default RadEditor's online demo and everything is fine.Could you please try it on your side and let us know if everything is fine?
WebAii version: 2010.2.713.0
RadControls for ASP.NET AJAX online demos version: 2010.2.713
using
System;
using
System.Text;
using
System.Collections.Generic;
using
ArtOfTest.WebAii.Core;
using
ArtOfTest.WebAii.TestTemplates;
using
Microsoft.VisualStudio.TestTools.UnitTesting;
using
Telerik.WebAii.Controls.Html;
namespace
HtmlSampleTests.Editor
{
/// <summary>
/// Summary description for UnitTest1
/// </summary>
[TestClass]
public
class
RadEditorSetText : BaseTest
{
private
TestContext testContextInstance =
null
;
/// <summary>
///Gets or sets the VS test context which provides
///information about and functionality for the
///current test run.
///</summary>
public
TestContext TestContext
{
get
{
return
testContextInstance;
}
set
{
testContextInstance = value;
}
}
//Use ClassCleanup to run code after all tests in a class have run.
[ClassCleanup()]
public
static
void
EditorClassCleanup()
{
ShutDown();
}
// Use TestInitialize to run code before running each test
[TestInitialize()]
public
void
MyTestInitialize()
{
#region WebAii Initialization
// Initialize(this.TestContext.TestLogsDir, new TestContextWriteLine(this.TestContext.WriteLine));
Settings settings = GetSettings();
settings.DefaultBrowser = BrowserType.InternetExplorer;
settings.RecycleBrowser =
true
;
settings.BaseUrl =
"http://demos.telerik.com/aspnet-ajax"
;
settings.ClientReadyTimeout = 60000;
settings.ExecuteCommandTimeout = 60000;
settings.AnnotateExecution =
true
;
settings.AnnotationMode = AnnotationMode.All;
// Now call Initialize again with your updated settings object
Initialize(settings,
new
TestContextWriteLine(
this
.TestContext.WriteLine));
// Set the current test method. This is needed for WebAii to discover
// its custom TestAttributes set on methods and classes.
// This method should always exist in [TestInitialize()] method.
SetTestMethod(
this
, (
string
)TestContext.Properties[
"TestName"
]);
#endregion
//
// Place any additional initialization here
//
}
[TestMethod]
public
void
SetHtmlTest()
{
Manager.LaunchNewBrowser();
ActiveBrowser.NavigateTo(
"/editor/examples/default/defaultcs.aspx"
);
//RadEditor editor = Find.ById<RadEditor>("RadEditor1");
RadEditor editor = Find.ByCustom<RadEditor>(a => a.ID.EndsWith(
"RadEditor1"
));
Assert.IsNotNull(editor,
"Did not find the editor"
);
editor.Html =
"Test Code"
;
}
}
}
Best wishes,
Petio Petkov
the Telerik team

I just checked and I too test against the
http://demos.telerik.com/aspnet-ajax/editor/examples/default/defaultcs.aspx
and a similar test works fine there.
The difference with our app I have to log in first and the app has multiple editors on the test page and each editor is wrapped in a user control.
I have other tests that click buttons on the editor on the same page that work just fine. This is the only test that fails with this test page of Editors.
I cannot attach the code file so am not sure how to get the test source to you. It is a bit too big to paste here.
No Ajax calls where made in this test.
I am trying to get a live URL for you to try. I will include that with the source code of the tests once I know where to send them.
John.
You'll need to open a support ticket to be able to attache files. Please place the test project into a .zip file and attach the .zip file to a new support ticket. We look forward to receiving it along with a live URL we can access to reproduce this problem.
All the best,
Cody
the Telerik team

We are sorry, but your support package is not active. This is due to one of the following reasons:
This is despite having a full licence for Asp.net ajax controls and registered for ArtOfTest WebAii framework.
I apologize for this problem. I have updated your account. Please try again. Let me know if you continue to have problems.
All the best,
Cody
the Telerik team

It still gives me the error message
New Bug Report
Note that the specified response time is applicable for business days only (Monday to Friday). More details on support options page.
You have an issue with...
We are sorry, but your support package is not active. This is due to one of the following reasons:
- You have not downloaded yet a Telerik product. To gain access to the support system, please download the free trial for the product you are interested in from Your Account / Your Products / Free Trials.
- Your 60 day trial support period has expired. If you would like to request a trial and support extension, please use the online Feedback form: http://www.telerik.com/automated-testing-tools/account/support-tickets/general-feedback.aspx
- The 1 year Support package associated with your developer license has expired. Please, visit Your Account / Your Products / Renewals and Upgrades for upgrade/renewal options.
You can still use the available online support resources to help you with your development:
- Documentation - all Telerik controls come with comprehensive help manuals to get you started. They are available with the product installation or online here: http://www.telerik.com/automated-testing-tools/support/documentation.aspx.
- Forum - the Forum is available to all Client.net account holders. Even though we actively monitor and answer posts, the Forum's main purpose is to offer convenient peer-to-peer help and we do not guarantee a reply to all threads.
- Blogs - the Telerik blogs are the perfect place to find out what Telerik developers are mostly interested in. There you will find information on new technologies, development tips and tricks, and their every day activities.
I just checked your account and the support options are active.
Please refer to this page http://www.telerik.com/account/support-tickets/new-bug-report.aspx (it will require log in).
Please note that your paid support options will be under Developer Productivity, as that is where the Ajax controls live. For more details on our product divisions and the changes to Your Account section, you can see here: http://www.telerik.com/company/changes-in-your-account.aspx
Apologies for the confusion, but we are in the transitional stages for this functionality and it will all be simplified soon.
Petia
the Telerik team