0

How to get the count of the element returned bythis.remote.findAllByXpath() in intern js (leadfoot).

CodeBlooded
  • 185
  • 5
  • 16

1 Answers1

1

I just played with leadfoot so not an expert but wouldn't it be something like this?

foo.findAllByXpath('/html/body/div')
    .then(function (rows) {
        console.log(rows.length);
    });
epascarello
  • 204,599
  • 20
  • 195
  • 236
  • This is correct. The `findAllBy` methods will resolve to an array of the found items, so just look at the array length to get the number of elements. – jason0x43 Mar 10 '17 at 18:02
  • I tried this before but was not working at that time. may be i was missing something. – CodeBlooded Mar 11 '17 at 12:55