I am writing a Protractor test, and as part of the test I wish to clear the content of a particular field (on a textarea), and then use the sendKeys method to write some content onto that textarea.
Here's the code from my test:
var commentField = element(by.css('input[ng-model="comment"]'));
console.log(commentField);
commentField.clear();
commentField.sendKeys('Here is a comment');
The console log confirms that I am indeed finding a control, but as soon as it hits the clear() method the test just hangs.
Any ideas what might be happening here?
We use browser.ignoreSynchronization = true;
if the page is not angular page. Because the protractor is coded for angular. But, I see ng selector:
var commentField = element(by.css('input[ng-model="comment"]'));
This error may be due to other things:
Make sure you use jasmine2 framework, and to update webdriver, type to command line this: webdriver-manager update
Just to let people know - I needed to use
browser.ignoreSynchronization = true;
after the call to move to the target page, but before attempting to click, clear or edit anything.
Happy days!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With