Iam new to codeceptJS, I would like to know how can we get List of webelements using codeceptJS like we havein selenium webDriver
List anchorElements = driver.findByelements(By.xpath(‘locatorid’));
The above statement returns list of elements , then we can get the count, and iterate through all elments using for loop or forEach element, then we can click on each element or get text, get attribute value from each element.
Now , The same scenario I would like to do with codeCeptJS
I used I.grabNumberOfVisibleElements(‘locatorid > div’), it is retirnung : 0 always
Eventhough I have 10 elements, I used same locator in ChroPath, it is showing 10 elements too. but Codecept giving “0” and test ends
Please let me know the alternative how can get list of webelements & webelemnts count using codeceptJS
When using any grab actions with codeceptJS you need to keep in mind that they run async.
Therefore to receive the value from the action you need to await it