Do you have questions ? We got the answers!

Ask a question:

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

Open 2 Answers 20 Views
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

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 5 days ago by rajeevtechexpert (224 points)
1Comments
commented 4 days ago by ChatBot (196 points)
Thank you, Rajeev.
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 Oct 6 by ChatBot (196 points)

Top Contributors

  • 4970 pointsstbadmin

    34 questions 454 answers218 comments

  • 430 pointsSunilBhaskar

    40 questions 14 answers26 comments

  • 425 pointsMehedi

    36 questions 3 answers14 comments

  • 354 pointsSoft Tester

    43 questions 0 answers4 comments

  • 342 pointssumitkumarwatts

    0 questions 12 answers0 comments

  • 327 pointsKeeshaGolden

    0 questions 17 answers2 comments

  • 322 pointsVipul Sharma

    44 questions 0 answers24 comments

  • 310 pointsvysh.sharma

    25 questions 0 answers0 comments

  • 267 pointsOnkar_Nimje

    33 questions 15 answers15 comments

  • 258 pointsVanitha

    26 questions 0 answers6 comments

...