I think a wide-first approach is more convenient when navigating cause  when 
testing for example you need to navigate step by step to accomplish your action 
.However the solution exists by précising the depth , it only needs to be added 
to the documentation .
I would like to ask again  if exists a solution, other then I mentioned, to 
force the action to wait until the previous job is done ?
Thanks


From: swtbot-dev-boun...@eclipse.org [mailto:swtbot-dev-boun...@eclipse.org] On 
Behalf Of Mickael Istria
Sent: mercredi 10 juillet 2013 11:03
To: swtbot-dev@eclipse.org
Subject: Re: [swtbot-dev] SWTbot Recorder

On 07/10/2013 11:28 AM, Radhouan BEN BAHRI wrote:
Hi ,
while  exploring the Generator/ Recorder option in the 2.1.0 release , I 
noticed that the recorder doesn't take into consideration the execution time of 
some actions, exp: ( the Run time or the build time for a project) and then it 
gives an incomplete code .
For me I overcome this issue first by doing a bot.sleep(3000) but it isn't  a 
good solution and it waste a lot of time and then I tried  creating a new shell 
with the name of the action window , for the build action  :
SWTBotShell shell = bot.shell("Build Project");
shell1.activate();
bot.waitUntil(shellCloses(shell));
but it is hard to detect the exact name of the window , SO is there any 
solution to force the action to wait until the previous job is done ?

That's a general issue with UI tests, not related to SWTBot nor to the recorder 
itself: as most actions are asynchronous, it's generally the responsability of 
the developer to put the necessary wait conditions and assertions. No recorder 
can guess what you're expecting and waiting for, it can only write down what 
you actually do.
This is explained on the documentation page for the recorder ( 
http://wiki.eclipse.org/SWTBot/Recorder#Limitations ).

However, it may be interesting to add to the recorder window some features to 
assist people in writing their wait conditions. Please open a feature request 
for that. Contributions are hightly welcome ;) 
http://wiki.eclipse.org/SWTBot/Contributing



 I have another remark ,
The search being recursive creates some problems ,for example when searching 
for menu "Project",

SWTbot finds the wrong "Project" menu item. It finds the one that is located in 
Search -> Text . so we must specify the depth : bot.menu("Project", 1);
I think it should be corrected in the next release.

>From a SWTBot POV, there is no such thing as "wrong" or "good" widget. So I 
>don't really understand your expectation. Would you prefer SWTBot to use a 
>wide-first approach instead of a depth-first? It would make sense, but it 
>might change the behaviour of some already existing tests, so it would be an 
>API change, which is something a stable project likes to avoid.

Cheers,
--
Mickael Istria
Eclipse developer at JBoss, by Red Hat<http://www.jboss.org/tools>
My blog<http://mickaelistria.wordpress.com> - My 
Tweets<http://twitter.com/mickaelistria>
_______________________________________________
swtbot-dev mailing list
swtbot-dev@eclipse.org
https://dev.eclipse.org/mailman/listinfo/swtbot-dev

Reply via email to