As a newcomer to both Javascript and QA testing, I am eager to ensure that all elements are loaded in the repeater before proceeding with my selection. My current goal is straightforward - I want to confirm that the first and last elements are present in the list before running my test.
I am open to suggestions on better ways to accomplish this task, so please share your ideas with me. While browsing online, I came across code snippets that demonstrate how to print the values of elements within repeaters.
To start off, I decided to simply print out the first and last elements to verify if I was targeting them correctly. This is what I attempted:
var repeaterElements = element.all(by.repeater(repeaterObj));
var text = repeaterElements.first().toString();
console.log(text);
My intention was to print the first element, but instead of getting the expected output, it printed [object Object]. Am I misunderstanding something here? I thought that '.first( )' would return the first element within the repeater!
-hopper