Getting CTabItem by text or tooltip text (Java, SWT)

Last edited on

Squish identifies identical CTabItem objects that reside in different CTabFolder objects with different object names, usually by introducing the “occurrence” property, for example:

Symbolic nameReal name
names.Project Explorer{"caption": "Project Explorer", "type": "org.eclipse.swt.custom.CTabItem"}
names.Project Explorer_2{"caption": "Project Explorer, "type": "org.eclipse.swt.custom.CTabItem", "occurrence": 1}

This can occur for example when having the same view (in the above object names it is the “Project Explorer” view) visible in different (Eclipse) perspectives.

Add this property to the CTabItem’s real name (will be done by Squish for newly generated/added object names automatically):

"parent.visible": True

So if the real name is…

{"caption": "Outline", "type": "org.eclipse.swt.custom.CTabItem"}

…change it to…

{"caption": "Outline", "parent.visible": True, "type": "org.eclipse.swt.custom.CTabItem"}