Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » clicking context menu steals selection
clicking context menu steals selection [message #758186] Tue, 22 November 2011 09:43 Go to next message
Jacek Pospychala is currently offline Jacek Pospychala
Messages: 159
Registered: July 2009
Senior Member
hi,
I'm trying to simulate user selecting a file in PHP Explorer and choosing "Run As -> PHPUnit Test" from context menu. Basically user expands the project in the explorer view, clicks on file, chooses option from context menu and runs it.

I did the following:

tree.expandNode("projectName") // expand project node in explorer
.select("calculatorTest.php") // select test file to run
.contextMenu("Run As") // click "Run As"

Now at this point I'd like to click submenu item, but my tree selection suddenly changes from "calculatorTest.php" to top level element. So I have to keep reference to RunAs menu, then again call:

...select("calculatorTest.php");

and then get the submenu and click it.

So my question is, if that's the expected behavior with tree selection getting changed during contextMenu() call,
or am I doing it wrong way?

btw. for getting the submenu item I'm using this: http://www.prait.ch/wordpress/?p=218

thanks!

Jacek
Re: clicking context menu steals selection [message #759416 is a reply to message #758186] Mon, 28 November 2011 15:42 Go to previous message
Ketan Padegaonkar is currently offline Ketan Padegaonkar
Messages: 873
Registered: July 2009
Senior Member
Hi Jacek,

I'm unable to reproduce this behavior. The contextMenu implementation of
treeItem (http://goo.gl/5gcS0) seems to be setting the selection on the
treeitem and sending events to the tree.

If this is always reproducible, would it be possible for you to share
the full trace level log output(http://goo.gl/5CXcM) of swtbot when this
happens?

Thanks!

-- Ketan

On 11/22/11 1:43 AM, Jacek Pospychala wrote:
> hi,
> I'm trying to simulate user selecting a file in PHP Explorer and
> choosing "Run As -> PHPUnit Test" from context menu. Basically user
> expands the project in the explorer view, clicks on file, chooses option
> from context menu and runs it.
> I did the following:
>
> tree.expandNode("projectName") // expand project node in explorer
> select("calculatorTest.php") // select test file to run
> contextMenu("Run As") // click "Run As"
>
> Now at this point I'd like to click submenu item, but my tree selection
> suddenly changes from "calculatorTest.php" to top level element. So I
> have to keep reference to RunAs menu, then again call:
>
> ..select("calculatorTest.php");
>
> and then get the submenu and click it.
>
> So my question is, if that's the expected behavior with tree selection
> getting changed during contextMenu() call,
> or am I doing it wrong way?
>
> btw. for getting the submenu item I'm using this:
> http://www.prait.ch/wordpress/?p=218
>
> thanks!
>
> Jacek
Previous Topic:Is there anyway to run my rcp tests from the commandline
Next Topic:Radio select doesn't seem to register any more
Goto Forum:
  


Current Time: Sat Oct 25 14:39:52 GMT 2014

Powered by FUDForum. Page generated in 0.02131 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software