Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » No idea now to refer to a menu item...
No idea now to refer to a menu item... [message #839286] Sun, 08 April 2012 12:25 Go to next message
joseph reddington is currently offline joseph reddington
Messages: 16
Registered: January 2012
Junior Member
Hi all,

I'm using swtbot to run a partilar junit test within an application to test a plugin - I use

tree.expandNode("SBFGTD").expandNode("src").expandNode("gtd.tests").expandNode("Ambiguous1.java")
.contextMenu("Open");

to select the file and to run it I use

bot.menu("Run").menu("Run As").menu("2 junit test");

except that this fails because the text for the "2 junit test" part of the menu includes some extra characters denoting the keyboard shortcut...
index.php/fa/7811/0/

What's my best way of either selecting the menu item or just running the junit test some other way?

Cheers,

Joe
Re: No idea now to refer to a menu item... [message #840876 is a reply to message #839286] Tue, 10 April 2012 15:54 Go to previous messageGo to next message
Lorenzo Bettini is currently offline Lorenzo Bettini
Messages: 1356
Registered: July 2009
Senior Member
On 04/08/2012 02:25 PM, joseph reddington wrote:
> Hi all,
>
> I'm using swtbot to run a partilar junit test within an application to test a plugin - I use
>
> tree.expandNode("SBFGTD").expandNode("src").expandNode("gtd.tests").expandNode("Ambiguous1.java")
> .contextMenu("Open");
>
> to select the file and to run it I use
>
> bot.menu("Run").menu("Run As").menu("2 junit test");
>
> except that this fails because the text for the "2 junit test" part of the menu includes some extra characters denoting the keyboard shortcut...
>

as for problems with menus with keyboard shortcuts I found a workaround, see

http://www.eclipse.org/forums/index.php/m/826081/

cheers
Lorenzo


--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
ICQ# lbetto, 16080134 (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
http://www.myspace.com/supertrouperabba
BLOGS: http://tronprog.blogspot.com http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net
Re: No idea now to refer to a menu item... [message #842407 is a reply to message #840876] Thu, 12 April 2012 09:12 Go to previous messageGo to next message
joseph reddington is currently offline joseph reddington
Messages: 16
Registered: January 2012
Junior Member
Hey - thanks for your reply. That looked like it would do the job, but when I gave it a go I made no progress...

I tried
"SWTBotMenu test = bot.menu("Run").menu("Run As").menu("JUnit Test ").click(); to run a Junit test and got a widget was null issue - any ideas?

Joe
Re: No idea now to refer to a menu item... [message #842539 is a reply to message #842407] Thu, 12 April 2012 11:44 Go to previous message
Lorenzo Bettini is currently offline Lorenzo Bettini
Messages: 1356
Registered: July 2009
Senior Member
On 04/12/2012 11:12 AM, joseph reddington wrote:
> Hey - thanks for your reply. That looked like it would do the job, but
> when I gave it a go I made no progress...
> I tried "SWTBotMenu test = bot.menu("Run").menu("Run As").menu("JUnit
> Test ").click(); to run a Junit test and got a widget was null issue -
> any ideas?
> Joe
>

I don't know whether this is your case, but for context menus you might
want to take a look at this

http://www.prait.ch/wordpress/?p=218

cheers
Lorenzo

--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
ICQ# lbetto, 16080134 (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
http://www.myspace.com/supertrouperabba
BLOGS: http://tronprog.blogspot.com http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net
Previous Topic:SWTBot access confusion...
Next Topic:HELP!!! SWTBot Question!!!
Goto Forum:
  


Current Time: Tue Sep 23 16:40:36 GMT 2014

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

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