How to check for enablement of right click menu item

WindowTester allows you to easily create and run unit tests for every GUI they build. It can also be used to generate system level tests.

Moderators: gnebling, Eric Clayberg, Dan Rubel, keertip, Phil Quitslund

How to check for enablement of right click menu item

Postby karthik.intels12 » Wed Apr 07, 2010 6:22 am

Hello Sir, How to check whether right click option is enabled or not.


Snippets:-

IWidgetLocator contextClick = ui.contextClick(new SWTWidgetLocator(Grid.class), "Copy");
ui.assertThat(contextClick.******);



I'm Right clicking on grid table viewer. i want to check whether copy is enabled or not. but isenabled() API is not available for IWidghetLocator i guess.. so which locator i should use to check for enablement condition
Thanks and Regards,
Karthik.M.S
karthik.intels12
 
Posts: 35
Joined: Wed Mar 31, 2010 4:37 am

Re: How to check for enablement of right click menu item

Postby Phil Quitslund » Mon Apr 12, 2010 10:14 am

We do not currently support selection or enablement assertions on Context clicks but are tracking this as a feature request. If you'd like to be informed when this is available, send a mail to wintest-support@instantiations.com.

Thanks!
--
Phil Quitslund
Software Engineer
Google, Inc.
Phil Quitslund
Moderator
 
Posts: 491
Joined: Fri Apr 28, 2006 6:26 am

Re: How to check for enablement of right click menu item

Postby karthik.intels12 » Tue Apr 13, 2010 6:11 am

Ok..! Thanks :) I will do it
Thanks and Regards,
Karthik.M.S
karthik.intels12
 
Posts: 35
Joined: Wed Mar 31, 2010 4:37 am

Re: How to check for enablement of right click menu item

Postby Phil Quitslund » Tue Apr 13, 2010 7:53 am

Good deal, thanks. This is a feature we've talked a bit about in the past so your feedback is useful.
--
Phil Quitslund
Software Engineer
Google, Inc.
Phil Quitslund
Moderator
 
Posts: 491
Joined: Fri Apr 28, 2006 6:26 am

Re: How to check for enablement of right click menu item

Postby karthik.intels12 » Tue Aug 24, 2010 7:55 pm

hello,

I found the work Around for this check


try {
this.ui.contextClick(new SWTWidgetLocator(Grid.class), "menu");
Assert.fail("failed because menu is available");
}
catch (WidgetNotFoundException e) {
// do nothing
}
Thanks and Regards,
Karthik.M.S
karthik.intels12
 
Posts: 35
Joined: Wed Mar 31, 2010 4:37 am

Re: How to check for enablement of right click menu item

Postby keertip » Fri Sep 24, 2010 11:22 am

Great! Thanks for posting the workaround.
keertip
Moderator
 
Posts: 221
Joined: Thu Mar 15, 2007 10:26 am


Return to Window Tester

Who is online

Users browsing this forum: No registered users and 1 guest