I already wrote some convenience methods for this in the Page Objects, for 
example:

dptdpo.clickTreeContextMenu("Assembly for B101|Assembly Template 004", "Add 
vehicle specific assembly");
dptdpo.selectTreeItem("Assembly for B101|Assembly Template 004");

It saves me a lot of code in the test, so it is more readable.

As you see, I use the character "|", but this is arbitrarily. It could be 
another separator as well. If it can be configured, then everyone would be 
happy, those who need ">" and those you need some other character. ">" seems to 
be a very good default character, better than mine.



--- On Mon, 10/20/08, Ketan Padegaonkar <[EMAIL PROTECTED]> wrote:
From: Ketan Padegaonkar <[EMAIL PROTECTED]>
Subject: [SWTBot-users] Thoughts on a new api to access menus/trees
To: swtbot-users@lists.sourceforge.net
Date: Monday, October 20, 2008, 2:20 AM

I've always been having thoughts about having a better api to access  
menus and trees. This is currently what most people do:  
bot.menu("file").menu("new").menu("other").click();
and similar stuff  
for trees as well.

How about: bot.menu("file>new>other").click() instead ?

This api would mean better and more concise API for most users. In  
case you have the character ">" as part of the menu/tree
item's text,  
an override would be nice so you could do something like:
bot.menu("file/new/other", '/').click() instead.

This should be trivial to implement since it merely involves splitting  
the string and chaining the call in a loop, but may break things for  
some users, so I'm contemplating this only for 2.0.

Feel free to drop in any ideas or suggestions that you may have around  
this API.

-- Ketan


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's
challenge
Build the coolest Linux based applications with Moblin SDK & win great
prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
SWTBot-users mailing list
SWTBot-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/swtbot-users
http://swtbot.org/ - a functional testing tool for SWT/Eclipse



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
SWTBot-users mailing list
SWTBot-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/swtbot-users
http://swtbot.org/ - a functional testing tool for SWT/Eclipse

Reply via email to