The difference is that SWTBotEclipseEditor#findEditors() will find all  
IEditorReference and you'll have to loop through it to do what you  
want. This is useful if for e.g. the file name is auto-generated for  
the sake of tests or you want to do something with the  
IEditorReference that SWTBot does not provide out of the box.

You'd use SWTEclipseBot#editor(fileName), if you're interested in a  
particular editor that you know about.

Also SWTEclipseBot#editor(fileName) provides a wrapper around an  
IEditorReference with neat API for performing operations you can do  
with editors, while SWTBotEclipseEditor#findEditors() provides  
IEditorReferences, with which you cannot do much.

-- Ketan

On 04-Oct-08, at 3:07 PM, Bob Mattei wrote:

> I’m using swtbot to test an eclipse application.  I’m far from an  
> expert on eclipse or Gui testing.  Can you explain why I would find  
> an editor using SWTBotEclipseEditor.findEditors() but not using  
> bot.editor(editorName);
>
>
> Snippet
>       List <IEditorReference> ieditors =  
> SWTBotEclipseEditor.findEditors();
>       for (int i = 0; i < ieditors.size(); i++) {
>         IEditorReference ied = ieditors.get(i);
>          if (ied.getName().equals(editorName)) {
>            // Find match and get to this code
>         }
>       }
>
>        bot.editor(editorName);  // Throws WidgetNotFoundException
>
>
>
>                   Thank you – Bob Mattei
>
> -------------------------------------------------------------------------
> 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
>

Cheers,
Ketan Padegaonkar,
I blog... therefore I am... http://ketan.padegaonkar.name
http://swtbot.org/ - a functional testing tool for SWT/Eclipse


-------------------------------------------------------------------------
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