| Summary: | WithLabel-matchers are not scoped to the ControlFinder, they do a shell-wide search instead | ||
|---|---|---|---|
| Product: | [Technology] SWTBot | Reporter: | Ralf Ebert <ralf> |
| Component: | SWTBot | Assignee: | Project Inbox <swtbot-inbox> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | Flags: | KetanPadegaonkar:
iplog+
|
| Version: | 2.0.0-dev | ||
| Target Milestone: | 2.0.0 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
| Attachments: | |||
Created attachment 177571 [details]
0001-SWTBotViewTest-viewBotWidgetScope-reproduces-Bug-323.patch
This happens because org.eclipse.swtbot.swt.finder.matchers.WithLabel does a shell-wide search if it is not instantiated with a parent. Expressing scope by parent and not by a Finder object seems bogus to me and this way of instantiating the matcher seems to be used. My current plan to fix this is to allow matchers (in general) to get the control finder they are used for by implementing an interface like IControlFinderAware#setControlFinder(). Created attachment 177610 [details]
0001-SWTBotViewTest-viewBotWidgetScope-reproduces-Bug-323.patch
Created attachment 177611 [details] 0002-323765-WithLabel-matchers-are-not-scoped-to-the-Cont.patch From: Ralf Ebert <ralf@ralfebert.de> Date: Fri, 27 Aug 2010 14:21:32 +0200 Subject: [PATCH 2/2] 323765: WithLabel-matchers are not scoped to the ControlFinder WithLabel finds controls using the ControlFinder now, so it is correctly restricted when used for scoped bots like viewById("...").bot(). For this, the SWTBot class is generated with an withLabel() method which passes in its ControlFinder. May I kindly ask to review the patches and give me feedback if there is anything left to do about them? Applied patch, sorry that it took a long time to resolve. Please verify and mark as fixed. |
Build Identifier: When searching for controls restricted to views or editors like bot.viewById("...").bot().textWithLabel("...") the WithLabel matcher will leave the parent Composite and return controls from other views. Reproducible: Always Steps to Reproduce: See attached test case SWTBotViewTest#viewBotWidgetScope