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.

  1. In the testTimeZoneView method, get the Widget from the returned SWTBotView.
  2. Create a Matcher using the WidgetMatcherFactory to find widgetsOfType(CTabItem.class).
  3. Use the bot.widgets method to search for a list of CTabItem instances in the view's widget.
  4. Ensure that the number of elements returned is equal to the number of time zone regions.
  5. 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.