I've started using Squish to automate Windows application using Python. A few scripts are working only with waitForObject
and a few with waitForObjectItem
. When should I use waitForObject
and when should I use waitForObjectItem
?

- 18,820
- 42
- 108
- 144

- 21
- 2
1 Answers
I often visit this: http://doc.froglogic.com/squish/latest/
It's really helping especially when I forget something. It's just helpful.
Here it is, just copy/pate from the above site:
waitForObject(objectOrName): Waits until the objectOrName object is accessible (i.e., it exists and is visible and enabled). It returns a reference to the object if successful or raises a (catchable) LookupError exception on failure
waitForObjectItem(objectOrName, itemIdentifier): Waits until the objectOrName object is accessible (i.e., it exists and is visible and enabled), and contains an item that is identified by the itemIdentifier and that is itself accessible. This function is typically used to access items inside containers such as lists, tables, and trees.
Now, in other words, I understand that
waitForObject: its just waiting for an object that exists now and are visible, meaning that if you have a window1, on top of window2, and last one, window2 is not visible because of window1, you won't use this function;
and
waitForObjectItem: having in mind the first fction, object exists and is visible and enabled and this Item can be a cell of a table; or a children from a tree, etc.

- 785
- 6
- 22