This is a migrated thread and some comments may be shown as answers.

Cannot set the content of a RAD Editor.

9 Answers 159 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
John Woakes
Top achievements
Rank 1
John Woakes asked on 27 Jul 2010, 11:00 PM
I am using the 2010.1.713.0 WebAii code with its Telerik.WebAii.Controls.Html.dll Translator for ASP.NET AJAX RAD Controls. I am using the latest controls dll 2010.2.713.35.

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

Sort by
0
Cody
Telerik team
answered on 28 Jul 2010, 12:04 AM
Hello John Woakes,

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
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
John Woakes
Top achievements
Rank 1
answered on 28 Jul 2010, 01:07 AM
The code is in C# not VB. You gave a VB solution. I tried declaring the variable as a RadEditor but still got the same error (as I would expect).

var in C# is a strongly typed object.

 

 

RadEditor ed2 = Find.ByCustom<Telerik.WebAii.Controls.Html.RadEditor>(a => a.ID.EndsWith("MqTelerikEditor"));


0
Petio Petkov
Telerik team
answered on 30 Jul 2010, 03:56 PM
Hi John Woakes,

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
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
John Woakes
Top achievements
Rank 1
answered on 30 Jul 2010, 08:40 PM

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.
0
Cody
Telerik team
answered on 30 Jul 2010, 09:25 PM
Hello John Woakes,

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
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
John Woakes
Top achievements
Rank 1
answered on 30 Jul 2010, 09:42 PM
I tried to enter a support ticket but I got the error

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.
0
Cody
Telerik team
answered on 30 Jul 2010, 11:14 PM
Hello John Woakes,

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
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
John Woakes
Top achievements
Rank 1
answered on 30 Jul 2010, 11:19 PM
Hi Cody,

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.
0
Petia
Telerik team
answered on 02 Aug 2010, 06:45 AM
Hi John,

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.

Greetings,
Petia
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
General Discussions
Asked by
John Woakes
Top achievements
Rank 1
Answers by
Cody
Telerik team
John Woakes
Top achievements
Rank 1
Petio Petkov
Telerik team
Petia
Telerik team
Share this question
or