Skip to content
This repository has been archived by the owner on Sep 8, 2020. It is now read-only.

Inserting text in Ace Editor via Protractor throws error #182

Closed
ashitvora-zz opened this issue Dec 20, 2017 · 2 comments
Closed

Inserting text in Ace Editor via Protractor throws error #182

ashitvora-zz opened this issue Dec 20, 2017 · 2 comments

Comments

@ashitvora-zz
Copy link

I am trying to run an automated test and one of the steps of a test case is to clear the Ace Editor and insert text in it.

Earlier I had regular content editable DIV and I was able to insert text in it but not anymore after switching to Ace Editor.

All I am doing is calling "clear" method on the element and then "sendText" on it. I tried adding "click" method before clear to make sure Ace Editor does have the focus and it did bring the focus to Ace Editor but it still throws an error that element should be user-editable to clear it.

I also tried putting a sleep of 5s before clearing it just in case, Clearing is getting triggered before Ace makes the div contenteditable.

Here's the exact error to be precise.
Failed: invalid element state: Element must be user-editable in order to clear it.

@Ugoku
Copy link

Ugoku commented Jan 9, 2018

I ran into this today, instead of doing element(by.css('#myAceEditor')).clear(); I fixed it by doing element(by.css('#myAceEditor textarea')).clear();

@ashitvora-zz
Copy link
Author

Worked for me.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants