Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
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
My blog - My Tweets

Back to the top