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

[Solved] RadEditor test fails on setting Html value

10 Answers 119 Views
ASP.NET AJAX WebAii RadControls
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
woaksie
Top achievements
Rank 2
woaksie asked on 07 Dec 2009, 09:20 PM
      var ed2 = Find.ByCustom<RadEditor>(a => a.ID.EndsWith("MqTelerikEditor")); 
      Assert.IsNotNull(ed2, "Did not find the editor"); 
 
      const string html = "More <br /> Stuff"
       
      ed2.Html = html
 

This code used to run successfully. Now it fails on the last line with this error message.

System.Threading.ThreadAbortException: Thread was being aborted. 
at ArtOfTest.WebAii.Messaging.Process.BrowserRemoted.AsyncListener() 
at System.Threading.ThreadHelper.ThreadStart_Context(Object state) 
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) 
at System.Threading.ThreadHelper.ThreadStart()  
ArtOfTest.WebAii.Exceptions.ExecuteCommandException: ExecuteCommand failed! 
InError set by the client. Client Error: 
System.InvalidOperationException: Javascript call [$find(\'ctl00_cContent_ctl00_MqTelerikEditor\').set_html(\'More <br /> Stuff\')] 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(\'More <br /> Stuff\')',ClientId:'Client_ea100b96-0136-4c7d-96a7-667c18ac4a4f',HasFrames:'False',FramesInfo:'',TargetFrameIndex:'-1',InError:'True',Response:'System.InvalidOperationException: Javascript call [$find(\'ctl00_cContent_ctl00_MqTelerikEditor\').set_html(\'More <br /> Stuff\')] 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. 
 
at ArtOfTest.WebAii.Core.Browser.ExecuteCommandInternal(BrowserCommand request) 
at ArtOfTest.WebAii.Core.Browser.ExecuteCommand(BrowserCommand request, Boolean performDomRefresh, Boolean waitUntilReady) 
at ArtOfTest.WebAii.Core.Browser.ExecuteCommand(BrowserCommand request) 
at ArtOfTest.WebAii.Core.Actions.InvokeScript(String script) 
at ArtOfTest.WebAii.BrowserSpecialized.InternetExplorer.InternetExplorerActions.InvokeScript(String script) 
at ArtOfTest.WebAii.Controls.HtmlControls.HtmlControl.GetValue<T>(String propertyName, T defaultValue) 
at ArtOfTest.WebAii.Controls.HtmlControls.HtmlControl.GetValue<T>(String propertyName) 
at ArtOfTest.WebAii.Controls.HtmlControls.HtmlControl.CallMethod<T>(String methodCall) 
at Telerik.WebAii.Controls.Html.RadEditor.set_Html(String value) 
at Marqui.Tests.wxWeb.ArtOfTest.TestArtOfTest.SetTextInEditorAndFetch() in TestArtOfTest.cs: line 88  

Any ideas?

10 Answers, 1 is accepted

Sort by
0
Missing User
answered on 08 Dec 2009, 04:22 PM
Hi John,

I tried your code, with some modification, on this demo page.  It worked alright on this end, and here is what I have:

[TestMethod]
    public void SampleWebAiiTest()
    {
        // Launch a browser instance
        Manager.LaunchNewBrowser(BrowserType.InternetExplorer);
        // The active browser
        //var ed2 = Find.ByCustom<RadEditor>(a => a.ID.EndsWith("MqTelerikEditor"));
        var ed2 = Find.ById<RadEditor>("RadEditor1");
        Assert.IsNotNull(ed2, "Did not find the editor");
        const string html = "More <br /> Stuff";
        ed2.Html = html;  
    }

I used the latest version of the framework that you posted you are using along with this ticket. Can you please confirm the above works on your end? Also, did you upgrade your Rad Controls or modifiy your pages/web app recently?

Kind regards,
Nelson Sin
the Telerik team


Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
woaksie
Top achievements
Rank 2
answered on 08 Dec 2009, 06:02 PM
I tried your code and it works in my environment.

In my case the page has multiple editors on it. I have a User Control that wraps the RadEditor. I dynamically insert multiple instances of the User Control on to my test page. I have been working on this User Control quite a bit. Unfortunatly (my bad) I haven't run the tests since October!!

I haven't updated the rad controls or the WebAii since then.

John.


0
Missing User
answered on 08 Dec 2009, 11:07 PM
Hi again John,

Just wanted to follow up and see if the issue has been resolved alright.  And please feel free to post back or create new threads if you run into anything else.

Regards,
Nelson
the Telerik team


Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
woaksie
Top achievements
Rank 2
answered on 08 Dec 2009, 11:16 PM
No it has not been resolved. Nothing has changed. I can successfully run the sample code against the demo site but it fails against my own page.

John.
0
Missing User
answered on 09 Dec 2009, 12:07 AM
Hello again John,

Ah, from your last post I got the impression that it would be just test code changes. Could you please  either insert the line String s = ActiveBrowser.ViewSourceString; or get that string property in the debugger, then copy/paste to a .txt file and attach it for us to look at?

Best wishes,
Nelson
the Telerik team

Quick Edit: Could you get the string right before your test code? Also, before the code you posted, please try inserting an ActiveBrowser.RefreshDom();. And did you put the control in a frame?

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.

0
woaksie
Top achievements
Rank 2
answered on 09 Dec 2009, 08:11 PM
I get this error when I try an attach the 214 KB PageSource.gif file. I am guessing it is because it is not a valid gif file.

Reply to thread cannot be created because: 
 
    * Please upload valid files: .gif,.jpg,.jpeg,.png smaller than 2MB.  


(This is the text file you requested. The attach file will only allow .gif .jpg .ppeg and .png so I named it pagesource.gif. Change the extension to txt to see the contents.)



The ActiveBrowser has a method called RefreshDomTree() which is what I think you were after. It did not fix my problem though.

John.
0
Missing User
answered on 09 Dec 2009, 09:21 PM
Hello again John,

You should be able to send the file zipped. After looking at the error again though, I believe the test code is finding something and trying to execute a script against it.

Which version of IE are you testing with? And did you put your implementation in a frame?

Since you mentioned the Editors are added dynamically and are wrapped in a custom control, I don't think we can find the problem only through the ticket system. Can we get temporary access to your app and the page that is causing problems?

You can also try rolling back to the previous framework version that was working to see if it still works.

Best wishes,
Nelson
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.

0
woaksie
Top achievements
Rank 2
answered on 09 Dec 2009, 09:26 PM
The attach file feature on this forum only allows image files. If I try and attach a zip file I get an error message File is not of correct type.

Can you email me at woaksie |at| marqui |dot| com and I can email you the file.
0
woaksie
Top achievements
Rank 2
answered on 09 Dec 2009, 09:34 PM
I am using IE 8.0.6001.18702

I am not using the editor in a frame.

At the moment I am only running this on my development machine. I am behind a corporate firewall and not able to open it up for you.

I only have ever had one version. It worked in October but does not now.

John.


0
Missing User
answered on 10 Dec 2009, 07:35 PM
Hello again John,

Can you add as much debugging output to your test code for the Editor properties as possible? So as in ed2.Html, ed2.Height, ed2.Id, etc.

Please note any descrepencies in any of the expected values for properties compared to what you actually wrote into the Editors or any other errors that may be thrown when accessing the properties. Also, please check out the ChildNodes collection property as well.

Also, can you try setting some of the other properties and see if they work as expected? And please try some of the method calls also, such as ed2.Click() and ed2.ScrollToVisible(). And also if you can get a screen shot of the Editor with ed2.Capture(); and see if it is the expected Editor.


Best wishes,
Nelson
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
ASP.NET AJAX WebAii RadControls
Asked by
woaksie
Top achievements
Rank 2
Answers by
Missing User
woaksie
Top achievements
Rank 2
Share this question
or