funmay
7 years agoContributor
Loop through the container of elements
I am new to Testcomplete with JavaScript.How can i loop through a collection/container of element?When all the elements are using the same class name/Id.I don't want run the test individually by using "contains". I want to loop through the container .
In Selenium i can do it with below code:
List<WebElement> vContainer = element.findElements(By.cssSelector("element));
if (vContainer .size() > 0) {
//Can iterate the list if you expect more than one div of type someDiv.
String myText = mightHaveSomeDiv.get(0).getText();
return element;