Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How does the widget finding algorithm work?

ALGORITHM widget
0
Posted

How does the widget finding algorithm work?

0

The widget finder searches the current active window for matches. Locators might match mutiple widgets (whether this case is exceptional depends on whether you use IUIContext.find(..) or IUIContext.findAll(..)). As a simple example, new ButtonLocator(“OK”) identifies a Button labeled “OK” in the current active window. If there is more than one such button in the active window, you can disambiguate the search by embellishing the locator with information about the Button’s location in the widget containment hierarchy. For instance, if the “OK” button of interest is the child of a Composite (and none other is), new ButtonLocator(“OK”, new SWTWidgetLocator(Composite.class)) will uniquely identify it. Whereever possible, you should name widgets that require disambiguation. See …. for more on this. For more on matching by containment look at the SWTWidgetLocator javadocs.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.