Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » Problem clicking context menu item(Uncheck context menu item by single click does not work)
Problem clicking context menu item [message #662882] Fri, 01 April 2011 11:28 Go to next message
manasa  is currently offline manasa
Messages: 32
Registered: October 2010
Member
Hi All,

I am new to SWTBot, and I am trying to get one scenario running.

I want to click on a context menu item in my view, and want to uncheck the item, so that there is no checked option against it, something very similar to Project - >Build Automatically option in the eclipse main menu.

I try the following code and i see that though it finds the item and clicks, but my context menu does not get unchecked.

bot.viewByTitle("Index View").menu("EObject Table").click();


Can anyone point out what is the mistake above or how can I check/uncheck a context menu, any other ways to achieve the same.
Thanks in advance,

Regards,
Manasa
Re: Problem clicking context menu item [message #662936 is a reply to message #662882] Fri, 01 April 2011 14:10 Go to previous messageGo to next message
Eclipse User
Originally posted by: david.landry.gmail.com

manasa wrote:
> Hi All,
>
> I am new to SWTBot, and I am trying to get one scenario running.
>
> I want to click on a context menu item in my view, and want to uncheck
> the item, so that there is no checked option against it, something very
> similar to Project - >Build Automatically option in the eclipse main menu.
>
> I try the following code and i see that though it finds the item and
> clicks, but my context menu does not get unchecked.
>
>
> bot.viewByTitle("Index View").menu("EObject Table").click();
>
>
> Can anyone point out what is the mistake above or how can I
> check/uncheck a context menu, any other ways to achieve the same.
> Thanks in advance,
>
> Regards,
> Manasa

New to this myself so not sure if I can help or hinder you, but I'll try:

First, are you talking about a contextMenu or a menu item? There is a
difference, and SWTBot has a separate class for those.

From your description it sounds as though it is a standard menu item,
and like the "build automatically" option it may require you explicity
specify the index.

try "bot.viewByTitle("Index View").menu("EObject Table",1).click();
Re: Problem clicking context menu item [message #663214 is a reply to message #662936] Mon, 04 April 2011 11:14 Go to previous message
manasa  is currently offline manasa
Messages: 32
Registered: October 2010
Member
Thanks for the reply.

Its a menu item that I am trying to work with.
I tried the following.
bot.viewByTitle("Index View").menu("EObject Table",0).click();

When I debug the same, I see that my SWTBot recognizes the menu item at index 0, and the click statement gets executed, but my menu item which was already checked still remains checked.
It does not get unchecked.

Are there any other ways to achieve this.

Thanks & Regards,
Manasa
Previous Topic:Doubleclick doesn't work on a empty SWTBotTable
Next Topic:Create element out of clipping window
Goto Forum:
  


Current Time: Sat Sep 20 16:16:29 GMT 2014

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

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