Hello, I am facing an issue where I keep receiving the message "element not visible" in protractor. All I want is for it to locate the input field and sendKeys to it, but it is not functioning as expected. The entire project site is built using AngularJS and I have already set browser.ignoreSynchronization = true; Any suggestions on how to resolve this?
HTML Code
input parse-search-query="" type="text" tabindex="1" name="search_query" autocomplete="off" placeholder="Search by City ST, Zip, or Address" data-ng-model="searchQueryFieldCtrl.searchFormController.searchParams.search_query" data-ng-change="searchQueryFieldCtrl.searchFormController.clearErrors()" data-focus-on="focusQuery || form.search_query.$error" data-uib-typeahead="suggestion as suggestion.label for suggestion in searchQueryFieldCtrl.getSuggestions($viewValue)" data-typeahead-focus-first="false" data-typeahead-min-length="0" data-typeahead-wait-ms="300" data-typeahead-on-select="searchQueryFieldCtrl.setSearch($item)" class="ng-pristine ng-untouched ng-valid ng-scope" aria-autocomplete="list" aria-expanded="false" aria-owns="typeahead-69-869">
spec.js
describe('New stack homepage test', function() {
it('should test search form', function() {
browser.ignoreSynchronization = true;
var flow = protractor.promise.controlFlow();
function waitOne() {
return protractor.promise.delayed(3000);
}
function sleep() {
flow.execute(waitOne);
}
browser.get('http://localhost:3000/');
sleep()
expect(browser.getTitle()).toEqual('Find Homes for Sale, Rent & Real Estate Listings Nationwide at Homes.com');
sleep()
var search = element.all(by.css("input[name='search_query']"));
sleep()
search.sendKeys('anything'); // this is not working
});
});