Time for action – interrogating views
Having been able to acquire a reference to the view, the next step is to deal with specific user interface components. For standard controls such as Button
and Text
, the bot
provides standard methods to acquire. To get hold of other components, the widget hierarchy will have to be interrogated directly.
- In the
testTimeZoneView
method, get theWidget
from the returnedSWTBotView
. - Create a
Matcher
using theWidgetMatcherFactory
to findwidgetsOfType(CTabItem.class)
. - Use the
bot.widgets
method to search for a list ofCTabItem
instances in the view's widget. - Ensure that the number of elements returned is equal to the number of time zone regions.
- The code looks like:
SWTBotView timeZoneView = bot.viewByTitle("Time Zone ...
Get Eclipse Plug-in Development Beginner's Guide - Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.