JavaScript send keys to element by model in repeater sendkeys element not interactable,send_keys element not visible,sendkeys to

Following this example: Protractor get element by model in repeater array, I am running into a head scratcher. I want to send input value to an element inside of a repeater. Hopefully it is a simple solution!

My HTML looks similar to this. The main difference being "posts" vs "user.posts".

<tr ng-repeat="post in user.posts">
    <td ng-click="activePost(post)" class="title">{{post.title}}</td>
    <td><button class="btn btn-danger" ng-click="delete(post)">Delete</button></td>
  <td><input type="text" ng-model="post.subtitle" 
        id="{{post.id}}" /></td>
 </tr>

Then following the example, I wrote something like this:

element.all(by.repeater('post in user.posts')).then(function(posts) {
   var activePost = posts[0].element(by.model('post.subtitle'));
   activePost.sendKeys('My post');
});

The protractor test fails at "activePost.sendKeys('My post')" with the following error:

NoSuchElementError: No element found using locator:  
by.model("post.subtitle"). 
Stacktrace:
         NoSuchElementError: No element found using locator: by.model("post.subtitle")
        at Array.forEach (native) Error
        at /Users/.../e2e/spec.js:51:17
        at Array.forEach (native) From: Task: Asynchronous test function: it() Error
        at [object Object].<anonymous> (/Users/.../e2e/spec.js:32:3)
        at Object.<anonymous> (/Users/.../e2e/spec.js:2:1)

Would anyone have any suggestions for what I could try or a different way to think about it? Thanks!

ANSWER: The error Protractor was throwing was completely unrelated to the repeater but instead to a missing ending div tag in the view. Isn't it occasionally something odd like that? Go figure.

Answer:1

In an application I am working on I build an HTML string of table rows for the purpose of appending to a table in the DOM. I want to save that string as HTML for use later on in a type ahead search ...

In an application I am working on I build an HTML string of table rows for the purpose of appending to a table in the DOM. I want to save that string as HTML for use later on in a type ahead search ...

I'm using QUnit in conjunction with require.js for unit-testing a backbone.js application. All of the tests are asynchronous, using the asyncTest method. I'm using setup and teardown to build and ...

I'm using QUnit in conjunction with require.js for unit-testing a backbone.js application. All of the tests are asynchronous, using the asyncTest method. I'm using setup and teardown to build and ...

  1. junit setup called before each test
  2. junit setup not called
  3. junit setup method called multiple times
  4. junit setup method not called
  5. junit when is setup called
  6. junit setup is called for each test

what is the best practice for display next panorama ? (change images) like this ? Event click button -> var materials = [ loadTexture( 'PANO_NEXT0001.jpg' ), // right ...

what is the best practice for display next panorama ? (change images) like this ? Event click button -> var materials = [ loadTexture( 'PANO_NEXT0001.jpg' ), // right ...

I am storing html in a mysql database as raw html. I am pulling the contents and placing it into an array as follows. The array is the json_encoded, but if there is any double quotes or urls then the ...

I am storing html in a mysql database as raw html. I am pulling the contents and placing it into an array as follows. The array is the json_encoded, but if there is any double quotes or urls then the ...

  1. encode html json
  2. html encode json string
  3. html encode json string c#
  4. html encode json response
  5. html encode json c#
  6. html encode json data
  7. escape html json
  8. escape html json java
  9. encode html into json
  10. encode html in json php
  11. encode html inside json
  12. encode html for json javascript
  13. encode html in json java
  14. html escape json string
  15. html escape json javascript
  16. json encode html entities
  17. json_encode html tags
  18. json encode html special characters
  19. json_encode html tags php
  20. json encode html online