Join 500+ Software Testing professionals. Solve problem and get your problem solved. Register Now!

0
How do I find number of items in the list returned by FindAllChildren in TestComplete?

Open 2 Answers 74 Views
0 2
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
1

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)

answered by (408 points)
1Comments
commented by (202 points)
Thank you, Rajeev.
0
0
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
answered by (202 points)

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.
...