When working with Protractor on a non-Angular page, I am trying to locate the CKEditor instance in order to update the data. The following code snippet works in the Chrome console:
CKEDITOR.instances.html_editor.setData("Hello")
However, when I attempt to perform this action in my test script using Protractor, I encounter the following issue:
it('should enter text in editor successfully', function() {
var composerPage = new ComposerPage();
browser.executeScript('return window.CKEDITOR');
window.CKEDITOR.instances.html_editor.setData( 'Hello' );
});
The error message displayed is:
Error: Failed: Cannot read property 'instances' of undefined
I have reviewed a similar question on Stack Overflow here, but it did not provide a solution to my problem.
If anyone has suggestions on how I can properly define the CKEditor instance and update the data, I would greatly appreciate it!