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

Support for automated scripts (Fluentlenium) to interact with Kendo UI Editor

2 Answers 31 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Roman
Top achievements
Rank 1
Roman asked on 06 Mar 2014, 05:10 PM
Hi guys
I've been using the Fluentenium framework in order to do automation tests under Selenium and i'd like to create some tests that can access the iframe that gets rendered when the Kendo UI Text Editor gets created, or somehow programmatically add content / extract content from it using this type of automation.
Do you guys support Fluentlenium at all? If not, are there other alternatives to interact with the Kendo UI Text Editor programmatically using automation?

Thanks
Roman Jaquez

2 Answers, 1 is accepted

Sort by
0
Accepted
Alex Gyoshev
Telerik team
answered on 10 Mar 2014, 09:31 AM
Hello Roman,

You can use the client-side API of the editor to set its content (the value method), by executing scripts in the page. For example,

var editor = $("#editor").data("kendoEditor");
editor.value("<p>foo</p>");
editor.trigger("change");

This will let you test your application rather than the editor itself.

Regards,
Alex Gyoshev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Roman
Top achievements
Rank 1
answered on 10 Mar 2014, 02:47 PM
Hey Alex
I came up with this based on your suggestion: 
-Since Fluentlenium allows you to execute javascript in an automated way, i did the following:
In Fluentlenium, in one of the tests, instantiate a WebDriver (in my case, a FireFoxDriver), then execute javascript against the Kendo UI Text Editor's API, as follows (given that test.html is the file that contains the text editor control, and the text editor's id is "textEdit":)

WebDriver driver =  new FirefoxDriver();
driver.get("test.html");
((JavascriptExecutor) driver).executeScript("$('#textEdit').data('kendoEditor').value('<b>Hello world</b>');");

It works like a charm!

Thanks for the help.
Roman
Tags
Editor
Asked by
Roman
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Roman
Top achievements
Rank 1
Share this question
or