Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » New SWTBot release
New SWTBot release [message #36074] Thu, 21 May 2009 05:03 Go to next message
Ketan Padegaonkar is currently offline Ketan Padegaonkar
Messages: 873
Registered: July 2009
Senior Member
Hi,

This is in continuation of my previous email[1] on some of the new
features in swtbot.

I've pushed in a new build of SWTBot in case you wish to try it out. If
you're going to be downloading this release, I'd highly recommend
reading these notes.

Some known issues:
1. Editor autocompletes and quickfixes is broken with eclipse 3.5M7 and RC1.

2. Menus inside eclipse are broken with eclipse 3.5M7 and RC1.

Some of the features:
1. Toggle button support
2. SWTBot can now be scoped to search within a particular widget:

microBot = bot.viewByLabel("Package Explorer").bot();
microBot.tree().select("MyProject");

This makes the earlier nuiances redundant:
widget = bot.viewByLabel("Package Explorer").getWidget();
SWTBotTree t = bot.widget(widget, widgetOfType(Tree.class));

3. Renamed SWTEclipseBot to SWTWorkbenchBot:
SWTEclipseBot is available but deprecated. Also the methods
view(viewLabel) and editor(fileName) are renamed to
viewByLabel(viewLabel) and editorByFileName(fileName);

4. Native mouse support (partial):
Clicking on certain widgets actually moves the mouse over them and
performs the click.

5. Native keyboard event(needs community inputs):
Performing type operations performs keyboard types using native events.
This requires that the community participates in sending in their
keyboard layouts[2] for inclusion in SWTBot.

6. Setting preferences is now easier.
Setting preferences is now a matter of setting a simple variable instead
of via System.setProperty().

[1] -
http://www.eclipse.org/newsportal/article.php?id=653&gro up=eclipse.swtbot#653
[2] - http://wiki.eclipse.org/SWTBot/Keyboard_Layouts

-- Ketan
Re: New SWTBot release [message #36109 is a reply to message #36074] Thu, 21 May 2009 10:03 Go to previous messageGo to next message
Richard Adams is currently offline Richard Adams
Messages: 77
Registered: July 2009
Location: Edinburgh
Member
Hi Ketan,
I just upgraded to 2.0.0.292, running Eclipse 3.4.1 on MacOSX10.5,
following your comment on bug

https://bugs.eclipse.org/bugs/show_bug.cgi?id=275127.

Unfortunately none of my now tests run properly. I've changed all bot
references to SWTWorkbenchBot, and the way I access views, but the
detection of dialogs seems not to work anymore.

ALl my tests start by creating a fresh project via the new project wizard
:

public static void getNewProjectWizardMainPage(SWTWorkbenchBot bot) throws
Exception{
// this still works and opens new project wizard
bot.menu("File").menu("New").menu("SBSI System").click();

// this was workng but now fails with timeout exception
bot.shell(NewSBSIProjectWizard.WINDOW_TITLE).activate();

}

The 'New Project' Dialog opens ok but the test fails with a 'widget not
found' exception as the open shell cannot be found - the test just hangs
and the dialog is not completed. I tried adding text by hand but his
rather loses the convenience of automated tests.

I read your two recent posts and can't see anything about this being
changed.
- Also, 'viewByLabel' is not present in API, but bot.viewByTitle is - are
they the same thing?

Thanks
Richard


Re: New SWTBot release [message #36143 is a reply to message #36074] Thu, 21 May 2009 22:08 Go to previous messageGo to next message
Derek  is currently offline Derek
Messages: 30
Registered: July 2009
Member
Ketan Padegaonkar wrote:

> Some of the features:
> 1. Toggle button support
> 2. SWTBot can now be scoped to search within a particular widget:

> microBot = bot.viewByLabel("Package Explorer").bot();
> microBot.tree().select("MyProject");

> This makes the earlier nuiances redundant:
> widget = bot.viewByLabel("Package Explorer").getWidget();
> SWTBotTree t = bot.widget(widget, widgetOfType(Tree.class));

Cool!
Glad to see new stuff happening :)
Re: New SWTBot release [message #36372 is a reply to message #36109] Sat, 23 May 2009 21:34 Go to previous messageGo to next message
Stefan Seelmann is currently offline Stefan Seelmann
Messages: 11
Registered: July 2009
Junior Member
Hi Richard,

Richard Adams wrote:
> Hi Ketan,
> I just upgraded to 2.0.0.292, running Eclipse 3.4.1 on MacOSX10.5,
> following your comment on bug
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=275127.
> Unfortunately none of my now tests run properly. I've changed all bot
> references to SWTWorkbenchBot, and the way I access views, but the
> detection of dialogs seems not to work anymore.

I got the same problem with 2.0.0.316.

I found out that there is a differnce between 2.0.0.316 and 2.0.0.204,
when starting a test as "SWTBot Test" from within Eclipse.

With 204 the command line contains
-application org.eclipse.swtbot.eclipse.core.swtbottestapplication

With 316 the command line contains
-application org.eclipse.pde.junit.runtime.uitestapplication

So it seems the "SWTBot Test" of 316 starts a PDE JUnit test.

As a workaround I just added the good argument to my runtime
configuration's arguments.

Kind Regards,
Stefan
Re: New SWTBot release [message #36399 is a reply to message #36372] Sun, 24 May 2009 05:10 Go to previous messageGo to next message
Ketan Padegaonkar is currently offline Ketan Padegaonkar
Messages: 873
Registered: July 2009
Senior Member
On 24/5/09 03:04, Stefan Seelmann wrote:
> I found out that there is a differnce between 2.0.0.316 and 2.0.0.204,
> when starting a test as "SWTBot Test" from within Eclipse.

I just ran a few tests myself, and the command line as returned by "ps
aux | grep java" contains
org.eclipse.swtbot.eclipse.core.swtbottestapplication and not pde's
uitestapplication as you mention.

-- Ketan
Re: New SWTBot release [message #36462 is a reply to message #36399] Sun, 24 May 2009 06:30 Go to previous messageGo to next message
Ketan Padegaonkar is currently offline Ketan Padegaonkar
Messages: 873
Registered: July 2009
Senior Member
Stefan,

Could you try deleting the launch configuration and execute the test
again ? I have a suspicion that this was possibly introduced[1] as part
of bug 274083[2]. Although nothing points me in this direction.

[1] -
http://github.com/ketan/swtbot/commit/cd9a676ce93864864353da 0aa9be13c3521c9b02
[2] - https://bugs.eclipse.org/bugs/show_bug.cgi?id=274083

-- Ketan

On 24/5/09 10:40, Ketan Padegaonkar wrote:
> On 24/5/09 03:04, Stefan Seelmann wrote:
>> I found out that there is a differnce between 2.0.0.316 and 2.0.0.204,
>> when starting a test as "SWTBot Test" from within Eclipse.
>
> I just ran a few tests myself, and the command line as returned by "ps
> aux | grep java" contains
> org.eclipse.swtbot.eclipse.core.swtbottestapplication and not pde's
> uitestapplication as you mention.
>
> -- Ketan
Re: New SWTBot release [message #36479 is a reply to message #36462] Sun, 24 May 2009 08:28 Go to previous messageGo to next message
Stefan Seelmann is currently offline Stefan Seelmann
Messages: 11
Registered: July 2009
Junior Member
Hi Ketan,
> Could you try deleting the launch configuration and execute the test
> again ? I have a suspicion that this was possibly introduced[1] as part
> of bug 274083[2]. Although nothing points me in this direction.

Still the same.

I tried some more:
- Installed a fresh Eclipse Ganymede 3.4.2
- Started with a fresh workspace
- Installed SWTBot 2.0.0.316 from update site [1]
- Created a test plugin with the following class:
-----------------------------------------------------
@RunWith(SWTBotJunit4ClassRunner.class)
public class MyFirstTest extends SWTBotEclipseTestCase {
@Test
public void OpenPerspective() throws Exception {
final SWTWorkbenchBot bot = new SWTWorkbenchBot();
bot.menu("Window").
menu("Open Perspective").
menu("Other...").click();
bot.shell("Open Perspective"); // <--hangs here
bot.table().select("Resource");
bot.button("OK").click();
}
}
-----------------------------------------------------
- Right-click the class and select Run As->SWTBot Test
--> The "Open Perspective" dialog is opened but hangs then.

I found another workaround:
In the run configuration's main tab, the selection is "Run a product"
and "org.eclipse.platform.ide". If I change this to "Run an application"
and "org.eclipse.swtbot.eclipse.core.swtbottestapplication" everything
works well.

I'll try with Eclipse 3.5 later, because I need JUnit 4.5.

Kind Regards,
Stefan


[1]
http://download.eclipse.org/technology/swtbot/ganymede/dev-b uild/update-site
Re: New SWTBot release [message #36509 is a reply to message #36479] Sun, 24 May 2009 11:52 Go to previous messageGo to next message
Ketan Padegaonkar is currently offline Ketan Padegaonkar
Messages: 873
Registered: July 2009
Senior Member
Thanks,

I think that is enough info. The only difference between galileo and
ganymede is the junit4 dependency. The code is the same.

Thanks!

-- Ketan

On 24/5/09 13:58, Stefan Seelmann wrote:
> Hi Ketan,
>> Could you try deleting the launch configuration and execute the test
>> again ? I have a suspicion that this was possibly introduced[1] as part
>> of bug 274083[2]. Although nothing points me in this direction.
>
> Still the same.
>
> I tried some more:
> - Installed a fresh Eclipse Ganymede 3.4.2
> - Started with a fresh workspace
> - Installed SWTBot 2.0.0.316 from update site [1]
> - Created a test plugin with the following class:
> -----------------------------------------------------
> @RunWith(SWTBotJunit4ClassRunner.class)
> public class MyFirstTest extends SWTBotEclipseTestCase {
> @Test
> public void OpenPerspective() throws Exception {
> final SWTWorkbenchBot bot = new SWTWorkbenchBot();
> bot.menu("Window").
> menu("Open Perspective").
> menu("Other...").click();
> bot.shell("Open Perspective"); //<--hangs here
> bot.table().select("Resource");
> bot.button("OK").click();
> }
> }
> -----------------------------------------------------
> - Right-click the class and select Run As->SWTBot Test
> --> The "Open Perspective" dialog is opened but hangs then.
>
> I found another workaround:
> In the run configuration's main tab, the selection is "Run a product"
> and "org.eclipse.platform.ide". If I change this to "Run an application"
> and "org.eclipse.swtbot.eclipse.core.swtbottestapplication" everything
> works well.
>
> I'll try with Eclipse 3.5 later, because I need JUnit 4.5.
>
> Kind Regards,
> Stefan
>
>
> [1]
> http://download.eclipse.org/technology/swtbot/ganymede/dev-b uild/update-site
Re: New SWTBot release [message #36790 is a reply to message #36509] Mon, 25 May 2009 10:14 Go to previous messageGo to next message
Ketan Padegaonkar is currently offline Ketan Padegaonkar
Messages: 873
Registered: July 2009
Senior Member
Hi Stefan,

I've fixed this issue with the latest build on the update site.

Could you test if that works fine ?

-- Ketan

On 24/5/09 17:22, Ketan Padegaonkar wrote:
> Thanks,
>
> I think that is enough info. The only difference between galileo and
> ganymede is the junit4 dependency. The code is the same.
>
> Thanks!
>
> -- Ketan
>
> On 24/5/09 13:58, Stefan Seelmann wrote:
>> Hi Ketan,
>>> Could you try deleting the launch configuration and execute the test
>>> again ? I have a suspicion that this was possibly introduced[1] as part
>>> of bug 274083[2]. Although nothing points me in this direction.
>>
>> Still the same.
>>
>> I tried some more:
>> - Installed a fresh Eclipse Ganymede 3.4.2
>> - Started with a fresh workspace
>> - Installed SWTBot 2.0.0.316 from update site [1]
>> - Created a test plugin with the following class:
>> -----------------------------------------------------
>> @RunWith(SWTBotJunit4ClassRunner.class)
>> public class MyFirstTest extends SWTBotEclipseTestCase {
>> @Test
>> public void OpenPerspective() throws Exception {
>> final SWTWorkbenchBot bot = new SWTWorkbenchBot();
>> bot.menu("Window").
>> menu("Open Perspective").
>> menu("Other...").click();
>> bot.shell("Open Perspective"); //<--hangs here
>> bot.table().select("Resource");
>> bot.button("OK").click();
>> }
>> }
>> -----------------------------------------------------
>> - Right-click the class and select Run As->SWTBot Test
>> --> The "Open Perspective" dialog is opened but hangs then.
>>
>> I found another workaround:
>> In the run configuration's main tab, the selection is "Run a product"
>> and "org.eclipse.platform.ide". If I change this to "Run an application"
>> and "org.eclipse.swtbot.eclipse.core.swtbottestapplication" everything
>> works well.
>>
>> I'll try with Eclipse 3.5 later, because I need JUnit 4.5.
>>
>> Kind Regards,
>> Stefan
>>
>>
>> [1]
>> http://download.eclipse.org/technology/swtbot/ganymede/dev-b uild/update-site
>>
>
Re: New SWTBot release [message #36824 is a reply to message #36790] Mon, 25 May 2009 21:19 Go to previous messageGo to next message
Stefan Seelmann is currently offline Stefan Seelmann
Messages: 11
Registered: July 2009
Junior Member
Works fine now,

Many thanks Ketan!


Ketan Padegaonkar wrote:
> Hi Stefan,
>
> I've fixed this issue with the latest build on the update site.
>
> Could you test if that works fine ?
>
Re: New SWTBot release [message #36927 is a reply to message #36824] Tue, 26 May 2009 13:42 Go to previous message
Richard Adams is currently offline Richard Adams
Messages: 77
Registered: July 2009
Location: Edinburgh
Member
Problem solved for me too,
thanks very much,
Richard


Previous Topic:Running SWTBot -Tests with an complete new instance of eclipse
Next Topic:SWTBotPreferences
Goto Forum:
  


Current Time: Fri Oct 24 08:43:39 GMT 2014

Powered by FUDForum. Page generated in 0.03698 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software