Checkout our demo site to practice selenium https://magento.softwaretestingboard.com/

0 like 0 dislike
916 views
by
I am currently using TestComplete for automation.

At one point, I have number of items in the item which I can identify using FindAllChildren method. How do I assert number of Items present in the list returned?

2 Answers

1 like 0 dislike
by The go-to Tester (448 points)

Software testing companies are more focused on automation testing and testComplete is one of the popular automation tool for automating the test cases.

"FindAllChildren" method is used to search all child objects that have specified values of the specified properties. The FindAllChildren method search starts from child objects of testedObj and continues down the object hierarchy to specified depth.

The FindAllChildren method is similar to “FindAll” method. The difference between them is that “FindAllChildren” only searches in child objects, whereas FindAll method checks properties of testedObj object.

If you have identified number of items using FindAllChildren method in form of List, then you can get the size of List by using size() function:

int listCount = listName.size()

Once you get the size of list, then you can compare the size of list using .assertEquals(int expected, int actual):

assertEquals(listCount, int actual)

by The go-to Tester (222 points)
Thank you, Rajeev.
0 like 0 dislike
by The go-to Tester (222 points)
Say you have identified the list, then you can compare the number of items as given below:

If UBound(myList) >= 0 Then
    Log.Message("Total number of items found: " & (UBound(myList) + 1))
  Else
    Log.Warning("No items found.")
  End If


This site is for software testing professionals, where you can ask all your questions and get answers from 1300+ masters of the profession. Click here to submit yours now!

1.4k questions

1.6k answers

866 comments

1.9k users

...