I am very new to protractor and still getting my head around promises btu am trying to do a, what I see as, a simple for loop. Basically I have an imbedded text editor that I cannot use the (element...).clear(); function with due to the element not being able to be interactive with.
So I would like to get the text length(x) in the text editor and then press the backspace x number of times, clearing the text.
Any help would be greatly appreciated.
element(by.css("div[class='ace_content']")).getText().then(function(textvalue) {
for (var i = textvalue.length; i == 0; i--) {
console.log("i =" + i)
element(by.css("div[class*='ace_editor'] > textarea")).sendKeys(protractor.Key.BACK_SPACE);
}