Well - in case someone else is curious (I cannot be the only person on earth trying to understand this material!) I worked on question 1 for myself: by the solid values ββof the code in the list, which I found that
element('li a')
... will select the last specified item.
Thus, with the seemingly insoluble problem of creating an element (), select a specific element in the list.
console.log("ROYDEBUG: " + element('li a'));
... returns "ROYDEBUG: [Object Object]" to the console log.
BUT I can understand that there are elements of the list "x". If I do this:
element('li a').query(function (selectedElements, done) { selectedElements.each(function(idx,elm) { var thisOne = selectedElements[idx];
Then I get this in the console:
ROYDEBUG: [object Object] ROYDEBUG: 0 - http://localhost:9876/app/index.html#/coupon/100 ROYDEBUG: 1 - http://localhost:9876/app/index.html#/coupon/100 ROYDEBUG: 2 - http://localhost:9876/app/index.html#/coupon/100 ROYDEBUG: 3 - http://localhost:9876/app/index.html#/coupon/100 ROYDEBUG: 4 - http://localhost:9876/app/index.html#/coupon/100 ROYDEBUG: 5 - http://localhost:9876/app/index.html#/coupon/100
... so he knows there are 6 items in the list. However, I cannot use "element (). Click ()" for these returned "elements" because they are just a text string from the "href =" part of each link (as you can see in the output on the console above).
source share