swtbot-users Mailing List for SWTBot - SWT/Eclipse functional testing (Page 24)
Brought to you by:
kpadegaonkar
You can subscribe to this list here.
| 2008 |
Jan
|
Feb
(14) |
Mar
(6) |
Apr
|
May
(15) |
Jun
(126) |
Jul
(128) |
Aug
(31) |
Sep
(35) |
Oct
(188) |
Nov
(47) |
Dec
(19) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2009 |
Jan
(25) |
Feb
(3) |
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
| 2010 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Hans S. <han...@ya...> - 2008-06-10 11:13:53
|
I use the example "org.eclipse.swt.examples.addressbook.AddressBook" for testing SWT Bot. How can I click the OK button on that image: http://img142.imageshack.us/img142/2909/okbuttonar1.gif If I write "bot.button("OK").click();" this exception occurs: net.sf.swtbot.widgets.WidgetNotFoundException: Could not find widget with text OK at net.sf.swtbot.widgets.AbstractSWTBot.<init>(AbstractSWTBot.java:127) at net.sf.swtbot.widgets.SWTBotButton.<init>(SWTBotButton.java:46) at net.sf.swtbot.SWTBot.button(SWTBot.java:191) at net.sf.swtbot.SWTBot.button(SWTBot.java:180) at SWTBotTest.testAddressBook(SWTBotTest.java:40) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at junit.framework.TestCase.runTest(TestCase.java:164) at junit.framework.TestCase.runBare(TestCase.java:130) at net.sf.swtbot.SWTBotTestCase.runBare(SWTBotTestCase.java:199) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:120) at junit.framework.TestSuite.runTest(TestSuite.java:230) at junit.framework.TestSuite.run(TestSuite.java:225) at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) Caused by: net.sf.swtbot.widgets.TimeoutException: Timeout after: 5000 ms.: Could not find widget at net.sf.swtbot.SWTBot.waitUntil(SWTBot.java:463) at net.sf.swtbot.SWTBot.waitUntil(SWTBot.java:446) at net.sf.swtbot.SWTBot.waitUntil(SWTBot.java:422) at net.sf.swtbot.widgets.AbstractSWTBot.<init>(AbstractSWTBot.java:114) ... 23 more |
|
From: Guillaume B. <gb...@ag...> - 2008-06-10 10:03:55
|
I tried to use SWTEclipseBot.view(String label) to select a view which
has been created at launch time but was never made visible (my
perspective contains two views within the same folder).
But if I just load the view (with IWorkbenchPage.showView("myViewID",
null, IWorkbenchPage.VIEW_CREATE); ) before calling
SWTEclipseBot.view(String label) everything works fine.
Maybe this check could be done in
SWTBotView.findWidget(IWorkbenchPartReference view, Finder finder)
when ((WorkbenchPartReference) view).getPane().getControl() returns a
null control.
Or does this null return value means something else ?
Cheers,
Guillaume.
|
|
From: Guillaume B. <gb...@ag...> - 2008-06-10 09:31:16
|
Thank you Hans, actually I am not confortable enough with RCP framework to use the recorder as described. (The main class is already warped into RCP, and I don't know how to explain which plugins should be used, and which shouldn't) Hans Schwaebli a écrit : > How to use the recorder is described here: > http://swtbot.sourceforge.net/wiki/Recorder > > I tried the script recorder with > "org.eclipse.swt.examples.addressbook.AddressBook". It didn't record > well. For example when clicking on "New Contact" and entering name, > first name etc., it doesn't record the whole input. > > > > */Guillaume Bourel <gb...@ag...>/* wrote: > > Hey, > > first, thanks a lot for this useful testing tool ! > > I'm currently using it with RCP applications and I was wondering > if the > script recorder could be used with such applications ? > > Cheers, > Guillaume. > > ------------------------------------------------------------------------- > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > http://sourceforge.net/services/buy/index.php > _______________________________________________ > SWTBot-users mailing list > SWT...@li... > https://lists.sourceforge.net/lists/listinfo/swtbot-users > http://swtbot.org/ - a functional testing tool for SWT/Eclipse > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > http://sourceforge.net/services/buy/index.php > ------------------------------------------------------------------------ > > _______________________________________________ > SWTBot-users mailing list > SWT...@li... > https://lists.sourceforge.net/lists/listinfo/swtbot-users > http://swtbot.org/ - a functional testing tool for SWT/Eclipse > > |
|
From: Hans S. <han...@ya...> - 2008-06-10 09:30:17
|
I use "org.eclipse.swt.examples.addressbook.AddressBook" for testing SWT Bot.
I created a data set by clicking "File -> New Contact".
Then I wanted to select the row, just to select it. In real life this is just one mouse click.
This is the statement:
bot.table(bot.shell("Address Book - Untitled")).select(0);
Unfortunately it does a double click on the row, so that it is shown in a popup dialog for editing.
How can I just select the row?
|
|
From: Hans S. <han...@ya...> - 2008-06-10 08:39:41
|
How to use the recorder is described here: http://swtbot.sourceforge.net/wiki/Recorder I tried the script recorder with "org.eclipse.swt.examples.addressbook.AddressBook". It didn't record well. For example when clicking on "New Contact" and entering name, first name etc., it doesn't record the whole input. Guillaume Bourel <gb...@ag...> wrote: Hey, first, thanks a lot for this useful testing tool ! I'm currently using it with RCP applications and I was wondering if the script recorder could be used with such applications ? Cheers, Guillaume. ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php _______________________________________________ SWTBot-users mailing list SWT...@li... https://lists.sourceforge.net/lists/listinfo/swtbot-users http://swtbot.org/ - a functional testing tool for SWT/Eclipse |
|
From: Guillaume B. <gb...@ag...> - 2008-06-10 07:49:51
|
Hey, first, thanks a lot for this useful testing tool ! I'm currently using it with RCP applications and I was wondering if the script recorder could be used with such applications ? Cheers, Guillaume. |
|
From: Ketan P. <ket...@gm...> - 2008-06-10 04:45:13
|
Thanks for the kind words, everyone! On 10-Jun-08, at 4:16 AM, Stefan Seelmann wrote: > SWTBot is a young project, but there were releases in March, May and > June. My impression is that it is under heavy development. I'd not necessarily say it's under heavy development, I'm pushing in new changes which are just enough to keep early adopters happy :) >> 2. Can an RCP GUI application be tested with it automatically? I >> mean, >> is everything possible, like accessing every widget for test >> automation >> in basically the same way a flesh and blood user can do? > > Right now not all widgets could be accessed. But there are new > features > and improvements in each release. For example in the current trunk > (labeld with 1.2) there is a new "click" method to select cells in a > table. Yes I'd not like to take credit for this one, it was one of the many patches submitted by Cédric Chabanois. >> I think this project can become a great one, popular and helpful to >> developers nearly as JUnit. > > 100% Ack. Thanks Ketan for your great work. Thanks, I'd like to point out here that most of the development on SWTBot is driven from what me my team need on a project at ThoughtWorks. A lot of it these days is driven by individuals asking for new features, connivence APIs. If someone does feel that there's something missing do feel free to write to the list, or file a bug on http://bugs.swtbot.org. Someone would be more than happy to resolve these for you, what's nice is that you don't even have to wait for a full release to happen -- I've setup CruiseControl to push out nightly builds to http://swtbot.sourceforge.net/artifacts/trunk/ . Cheers, Ketan Padegaonkar, I blog... therefore I am... http://ketan.padegaonkar.name http://swtbot.org/ - a functional testing tool for SWT/Eclipse |
|
From: Stefan S. <see...@ap...> - 2008-06-09 22:45:57
|
Hi I just wanted to share my experience. Hans Schwaebli wrote: > I just figured out today that there is such a tool I was looking for, > and it is called SWT Bot. > > Let me explain what we are looking for. We search for a tool to test RCP > applications (GUI) in a similiar way like with Selenium for web GUIs. We > use the latter with good success. > We, the Apache Directory Project, started using SWTBot for testing Apache Directory Studio. We also integrated it in our Maven build. The best way to learn how to use SWTBot for me was to take a look into the test sources. > > SWT Bot seems to be in an early phase. So there are some questions: > 1. Will it be developed continously, improved, maintained, expanded, > updated etc.? SWTBot is a young project, but there were releases in March, May and June. My impression is that it is under heavy development. > 2. Can an RCP GUI application be tested with it automatically? I mean, > is everything possible, like accessing every widget for test automation > in basically the same way a flesh and blood user can do? Right now not all widgets could be accessed. But there are new features and improvements in each release. For example in the current trunk (labeld with 1.2) there is a new "click" method to select cells in a table. > > I think this project can become a great one, popular and helpful to > developers nearly as JUnit. 100% Ack. Thanks Ketan for your great work. Greetings from Munich, Stefan |
|
From: Hans S. <han...@ya...> - 2008-06-09 16:09:08
|
As you know, I am analysing GUI test tools for RCP applications.
What advantages and disadvantages does "SWT Bot" have compared to "Abbot (& Costello)"?
|
|
From: Hans S. <han...@ya...> - 2008-06-09 14:52:49
|
When I run "net.sf.swtbot.demo.SWTBotDemo" I get this exception:
Exception in thread "main" net.sf.swtbot.widgets.WidgetNotFoundException: Could not find widget with text One
at net.sf.swtbot.widgets.AbstractSWTBot.<init>(AbstractSWTBot.java:128)
at net.sf.swtbot.widgets.SWTBotButton.<init>(SWTBotButton.java:46)
at net.sf.swtbot.SWTBot.button(SWTBot.java:192)
at net.sf.swtbot.SWTBot.button(SWTBot.java:181)
at net.sf.swtbot.demo.SWTBotDemo.playWithListeners(SWTBotDemo.java:156)
at net.sf.swtbot.demo.SWTBotDemo.perform(SWTBotDemo.java:81)
at net.sf.swtbot.demo.SWTBotDemo.start(SWTBotDemo.java:56)
at net.sf.swtbot.demo.SWTBotDemo.main(SWTBotDemo.java:42)
Caused by: net.sf.swtbot.widgets.TimeoutException: Timeout after: 5000 ms.: Could not find widget
at net.sf.swtbot.SWTBot.waitUntil(SWTBot.java:462)
at net.sf.swtbot.SWTBot.waitUntil(SWTBot.java:445)
at net.sf.swtbot.SWTBot.waitUntil(SWTBot.java:423)
at net.sf.swtbot.widgets.AbstractSWTBot.<init>(AbstractSWTBot.java:115)
... 7 more
It seems that SWT Bot cannot access the button, although I don't see any reason why not. If I comment the statement "bot.button("One").click();" then the rest of the demo works.
|
|
From: Ketan P. <ket...@gm...> - 2008-06-09 14:20:22
|
I've set up a cruise control so that a nightly build of SWTBot gets pushed here: http://swtbot.sourceforge.net/artifacts/trunk Here are the locations for the various artifacts: Update site: http://swtbot.sourceforge.net/artifacts/trunk/update-site/ JUnit reports: http://swtbot.sourceforge.net/artifacts/trunk/junit/ Coverage reports: http://swtbot.sourceforge.net/artifacts/trunk/coverage/ API docs: http://swtbot.sourceforge.net/artifacts/trunk/apidocs/ This should be useful for people who wish to use the latest and greatest releases of SWTBot after they've filed in bugs and feature requests and don't want to wait until I make a release. -- Ketan |
|
From: Ketan P. <ket...@gm...> - 2008-06-09 14:18:06
|
The recorder is available for plain SWT. It still needs support for a lot more controls, and needs a lot of work. You can read more about the recorder here: http://swtbot.sourceforge.net/wiki/Recorder Cheers, Ketan Padegaonkar, I blog... therefore I am... http://ketan.padegaonkar.name http://swtbot.org/ - a functional testing tool for SWT/Eclipse On 09-Jun-08, at 6:28 PM, Hans Schwaebli wrote: > I read: "SWTBot has a driver and recorder to playback and record > tests and integrates with Eclipse..." > > I couldn't find the recorder. Where is it? In Eclipse I see no > recorder after I installed SWT Bot. > > By the way, where are you located geographically (because of time > zone)? > ------------------------------------------------------------------------- > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > http://sourceforge.net/services/buy/index.php_______________________________________________ > SWTBot-users mailing list > SWT...@li... > https://lists.sourceforge.net/lists/listinfo/swtbot-users > http://swtbot.org/ - a functional testing tool for SWT/Eclipse > > |
|
From: Ketan P. <ket...@gm...> - 2008-06-09 14:16:29
|
The sources are already available with the binaries. In case you mean editable-sources, perhaps you could hack in into the ant build script to generate an archive with all the sources in it. Cheers, Ketan Padegaonkar, I blog... therefore I am... http://ketan.padegaonkar.name http://swtbot.org/ - a functional testing tool for SWT/Eclipse On 09-Jun-08, at 7:38 PM, Hans Schwaebli wrote: > Can you please provide downloading the source edition for each major > release of SWT Bot? > > I know it is a priority issue (and time). Would be convenient for > users and more foolproof than checking it out. > > Maybe I even could help you with that. |
|
From: Hans S. <han...@ya...> - 2008-06-09 14:08:29
|
Can you please provide downloading the source edition for each major release of SWT Bot?
I know it is a priority issue (and time). Would be convenient for users and more foolproof than checking it out.
Maybe I even could help you with that.
|
|
From: Hans S. <han...@ya...> - 2008-06-09 12:58:59
|
I read: "SWTBot has a driver and recorder to playback and record tests and integrates with Eclipse..."
I couldn't find the recorder. Where is it? In Eclipse I see no recorder after I installed SWT Bot.
By the way, where are you located geographically (because of time zone)?
|
|
From: Hans S. <han...@ya...> - 2008-06-09 12:38:54
|
I just figured out today that there is such a tool I was looking for, and it is called SWT Bot.
Let me explain what we are looking for. We search for a tool to test RCP applications (GUI) in a similiar way like with Selenium for web GUIs. We use the latter with good success.
We already discovered that we share the same values, which means to code the GUI tests as Java programs and use an open source framework for it. By the way, Netbeans Jemmy (for testing Swing GUIs) commits itself to the same philosophy.
SWT Bot seems to be in an early phase. So there are some questions:
1. Will it be developed continously, improved, maintained, expanded, updated etc.?
2. Can an RCP GUI application be tested with it automatically? I mean, is everything possible, like accessing every widget for test automation in basically the same way a flesh and blood user can do?
I think this project can become a great one, popular and helpful to developers nearly as JUnit.
|
|
From: Ketan P. <ket...@gm...> - 2008-06-05 18:49:28
|
On 05-Jun-08, at 11:58 PM, Somesh Sasalatti wrote: > In the meanwhile, is it not possible to run a test in junit plugin > test-headless mode and launch a workbench( ui thread) instead of > creating a custom swtbot launch config. A JUnit launch is far different from a simple java launch, where eclipse adds itself as a listener so that you can see updates in the junit view, throw PDE into this mix and things get complex really quick. You *could* possibly look at the JVM arguments of a JUnit plugin launch and try to perform a java launch with the same/similar arguments. You'll however not get notifications of test execution in the JUnit view, and may need to figure out alternative reporting mechanisms. I'd personally recommend running a command line build where you can do all the fancy instrumentation that you ever wanted to and get all the reports after a test run. On another note, I'm not sure if code coverage by executing functional tests is a good idea. Functional test coverage should be the number of scenarios that you've got automation for against the number of scenarios that have been developed. Cheers, Ketan Padegaonkar, I blog... therefore I am... http://ketan.padegaonkar.name http://swtbot.org/ - a functional testing tool for SWT/Eclipse |
|
From: Somesh S. <som...@gm...> - 2008-06-05 18:28:45
|
Hi Ketan, I think it is pretty safe to assume that clover and Ecl Emma might not end up supporting other non-standard launch configs. I have asked them if they provide any hooks. hoping to hear from them soon. In the meanwhile, is it not possible to run a test in junit plugin test-headless mode and launch a workbench( ui thread) instead of creating a custom swtbot launch config. that way, we would still be in the junit-plugin test config world and integration with code coverage tools would be seamless. thoughts? Somesh On Tue, Jun 3, 2008 at 6:41 PM, Somesh Sasalatti <som...@gm...> wrote: > hmm...would be nice if they were more specific. we are actually running > clover on our plugin from within Eclipse. > > > On Tue, Jun 3, 2008 at 5:27 PM, Ketan Padegaonkar < > ket...@gm...> wrote: > >> >> On 04-Jun-08, at 3:17 AM, Somesh Sasalatti wrote: >> >> > Hi, >> > Has anyone tried getting code coverage using clover on the code base >> > that they are testing with SWT bot? >> >> >> >> >> http://confluence.atlassian.com/display/CLOVER/Clover-for-Eclipse+Installation+Guide >> mentions that eclipse-PDE is not supported (yet) >> >> Cheers, >> Ketan Padegaonkar, >> I blog... therefore I am... http://ketan.padegaonkar.name >> http://swtbot.org/ - a functional testing tool for SWT/Eclipse >> >> >> ------------------------------------------------------------------------- >> Check out the new SourceForge.net Marketplace. >> It's the best place to buy or sell services for >> just about anything Open Source. >> http://sourceforge.net/services/buy/index.php >> _______________________________________________ >> SWTBot-users mailing list >> SWT...@li... >> https://lists.sourceforge.net/lists/listinfo/swtbot-users >> http://swtbot.org/ - a functional testing tool for SWT/Eclipse >> >> > |
|
From: Somesh S. <som...@gm...> - 2008-06-04 01:41:50
|
hmm...would be nice if they were more specific. we are actually running clover on our plugin from within Eclipse. On Tue, Jun 3, 2008 at 5:27 PM, Ketan Padegaonkar < ket...@gm...> wrote: > > On 04-Jun-08, at 3:17 AM, Somesh Sasalatti wrote: > > > Hi, > > Has anyone tried getting code coverage using clover on the code base > > that they are testing with SWT bot? > > > > > http://confluence.atlassian.com/display/CLOVER/Clover-for-Eclipse+Installation+Guide > mentions that eclipse-PDE is not supported (yet) > > Cheers, > Ketan Padegaonkar, > I blog... therefore I am... http://ketan.padegaonkar.name > http://swtbot.org/ - a functional testing tool for SWT/Eclipse > > > ------------------------------------------------------------------------- > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > http://sourceforge.net/services/buy/index.php > _______________________________________________ > SWTBot-users mailing list > SWT...@li... > https://lists.sourceforge.net/lists/listinfo/swtbot-users > http://swtbot.org/ - a functional testing tool for SWT/Eclipse > > |
|
From: Somesh S. <som...@gm...> - 2008-06-04 01:40:03
|
Hey Ketan, unfortunately, our pde build currently doesn't integrate with clover. There's some config screw up which I guess I'll get to later(or maybe earlier if I don't find a solution for the current problem) For this current problem, let's assume that I am only within Eclipse using its standard build and launch capabilities. Therefore I can only work with clovers launch configuration which supports the standard configs like junit and junit-plugin tests. But in SWTBot's case, there's a third type of config that Clover obviously doesn't recognize. So i was wondering if there's a way to provide a hook in plugin.xml in SWT bot that Clover can pick up on. I'll post on their forum anyways. Coming back to PDE build. have you written swtbot ui tests for a code that's built with pde-build which integrates with clover? The reason for this question is that I've haven't succeded in integrating clover with pde-build but assuming that I do, I wanted to know if swt bot will work. Thanks Somesh On Tue, Jun 3, 2008 at 4:57 PM, Ketan Padegaonkar < ket...@gm...> wrote: > Hi Somesh, > > I believe clover does modifications at the source level rather than at > the bytecode level: > http://confluence.atlassian.com/display/CLOVER/clover-instr > . So you should be able to modify the source *before* you give the > source to PDE build. > > This is easier to do if you can hack in into the build scripts. Rather > than at the wizard level. Perhaps you could talk to clover support to > see what they do to in order to 'hook-in' clover using whatever > dialog, and hack that feature in into your own clover-swtbot launch > config. > > Cheers, > Ketan Padegaonkar, > I blog... therefore I am... http://ketan.padegaonkar.name > http://swtbot.org/ - a functional testing tool for SWT/Eclipse > > On 04-Jun-08, at 3:17 AM, Somesh Sasalatti wrote: > > > Hi, > > Has anyone tried getting code coverage using clover on the code base > > that they are testing with SWT bot? > > > > What I want to do is this. > > 1) i have a test running as a swtbot test > > 2) i want to see the code coverage that this tests hits. > > 3) for that i need to run the test with clover. > > > > > > SWT-bot has its own launcher in Eclipse, i.e. in the "open run > > dialog" option, you'd see a SWTBot Test launch configuration type. > > > > Clover has its own run dialog and SWT Bot config isn't visible there. > > I wonder if Clover has any hooks that can be used to enable SWTBot > > with Clover? > > or if there's another way. > > > > Thanks > > Somesh > > > > ------------------------------------------------------------------------- > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > http://sourceforge.net/services/buy/index.php > _______________________________________________ > SWTBot-users mailing list > SWT...@li... > https://lists.sourceforge.net/lists/listinfo/swtbot-users > http://swtbot.org/ - a functional testing tool for SWT/Eclipse > > |
|
From: Ketan P. <ket...@gm...> - 2008-06-04 00:27:58
|
On 04-Jun-08, at 3:17 AM, Somesh Sasalatti wrote: > Hi, > Has anyone tried getting code coverage using clover on the code base > that they are testing with SWT bot? http://confluence.atlassian.com/display/CLOVER/Clover-for-Eclipse+Installation+Guide mentions that eclipse-PDE is not supported (yet) Cheers, Ketan Padegaonkar, I blog... therefore I am... http://ketan.padegaonkar.name http://swtbot.org/ - a functional testing tool for SWT/Eclipse |
|
From: Ketan P. <ket...@gm...> - 2008-06-03 23:57:56
|
Hi Somesh, I believe clover does modifications at the source level rather than at the bytecode level: http://confluence.atlassian.com/display/CLOVER/clover-instr . So you should be able to modify the source *before* you give the source to PDE build. This is easier to do if you can hack in into the build scripts. Rather than at the wizard level. Perhaps you could talk to clover support to see what they do to in order to 'hook-in' clover using whatever dialog, and hack that feature in into your own clover-swtbot launch config. Cheers, Ketan Padegaonkar, I blog... therefore I am... http://ketan.padegaonkar.name http://swtbot.org/ - a functional testing tool for SWT/Eclipse On 04-Jun-08, at 3:17 AM, Somesh Sasalatti wrote: > Hi, > Has anyone tried getting code coverage using clover on the code base > that they are testing with SWT bot? > > What I want to do is this. > 1) i have a test running as a swtbot test > 2) i want to see the code coverage that this tests hits. > 3) for that i need to run the test with clover. > > > SWT-bot has its own launcher in Eclipse, i.e. in the "open run > dialog" option, you'd see a SWTBot Test launch configuration type. > > Clover has its own run dialog and SWT Bot config isn't visible there. > I wonder if Clover has any hooks that can be used to enable SWTBot > with Clover? > or if there's another way. > > Thanks > Somesh |
|
From: Somesh S. <som...@gm...> - 2008-06-03 21:48:27
|
Hi, Has anyone tried getting code coverage using clover on the code base that they are testing with SWT bot? What I want to do is this. 1) i have a test running as a swtbot test 2) i want to see the code coverage that this tests hits. 3) for that i need to run the test with clover. SWT-bot has its own launcher in Eclipse, i.e. in the "open run dialog" option, you'd see a SWTBot Test launch configuration type. Clover has its own run dialog and SWT Bot config isn't visible there. I wonder if Clover has any hooks that can be used to enable SWTBot with Clover? or if there's another way. Thanks Somesh |
|
From: Ketan P. <ket...@gm...> - 2008-05-30 04:15:27
|
Hi Somesh, The reason why this fails is two fold: 1. Running JUnit plugin tests run in the UI thread. SWTBot should 'ideally' be run in non-UI thread. 2. The New Java project dialog (like most others) is a blocking dialog and blocks tests because they run in the UI thread. The trick here is to run the test as a SWTBot test-case. There's a right click option under in order to be able to do this. The launcher ensures that the tests run in a non-UI thread. Also you could extend from SWTBotTestCase which is part of 1.0. You will get some new assertions and a bunch of cool features if you subclass from SWTBotTestCase. Watch out for 1.1 which should be out this or next weekend :) Documentation is bad, I agree! It's a one man army and I can only do so much. Do feel free to add stuff to the Wiki if you feel to. PS: You need to subscribe to the mailing list in order to post. Cheers, Ketan Padegaonkar I blog... therefore I am... http://ketan.padegaonkar.name http://swtbot.org/ - a functional testing tool for SWT/Eclipse On 30-May-08, at 7:43 AM, Somesh Sasalatti wrote: > Hi Ketan, > you probably don't remember me but we had lunch on the first day at > EclipseCon 2008. > Anyhow, I am trying to use SWT Bot to test a plugin that we have > written. > > I am trying to invoke a wizard and type stuff in it and press finish. > It opens up the wizard but hangs in menu.click(); and therefore I > can't seem to continue. > > I tried creating a test case to invoke the standard java project > wizard > here is the some sample code that i tried but it didn't work > > added a file in a fresh plugin project > > > import org.eclipse.swt.widgets.Widget; > > import net.sf.swtbot.SWTBot; > import net.sf.swtbot.SWTBotTestCase; > import net.sf.swtbot.eclipse.finder.SWTEclipseBot; > import net.sf.swtbot.widgets.SWTBotMenu; > import net.sf.swtbot.widgets.SWTBotShell; > import net.sf.swtbot.widgets.TimeoutException; > import net.sf.swtbot.widgets.WidgetNotFoundException; > > public class test extends TestCase{ > > public void testProjectInvoke() throws WidgetNotFoundException{ > SWTEclipseBot bot = new SWTEclipseBot(); > bot.menu("File").menu("New").menu("Java Project").click(); > try { > bot.shell("New Java Project").activate(); > bot.textWithLabel("Project name:").setText("MyProject"); > bot.button("Finish").click(); > } catch (TimeoutException e) { > // TODO Auto-generated catch block > e.printStackTrace(); > } > > > > } > > } > > ran this as a Junit-Plugin Test > > on running this target, a target Eclipse sdk.ide is launched, the > wizard shows up and hangs. > > I tried to debug and it seems that it doesn't come out of line 212 > in AbstractSWTBot.java ( widget.notifyListeners(...) ); > > Any help is appreciated. > > Also, I struggled to find some examples with testing Eclipse > Plugins. It'd be nice to have some test samples around on the wiki. > I do not want to go the record and play way but want to write tests > just like i would write a junit test. > > Thanks in advance. > Somesh |
|
From: Somesh S. <som...@gm...> - 2008-05-30 02:13:15
|
Hi Ketan,
you probably don't remember me but we had lunch on the first day at
EclipseCon 2008.
Anyhow, I am trying to use SWT Bot to test a plugin that we have written.
I am trying to invoke a wizard and type stuff in it and press finish.
It opens up the wizard but hangs in menu.click(); and therefore I can't seem
to continue.
I tried creating a test case to invoke the standard java project wizard
here is the some sample code that i tried but it didn't work
added a file in a fresh plugin project
import org.eclipse.swt.widgets.Widget;
import net.sf.swtbot.SWTBot;
import net.sf.swtbot.SWTBotTestCase;
import net.sf.swtbot.eclipse.finder.SWTEclipseBot;
import net.sf.swtbot.widgets.SWTBotMenu;
import net.sf.swtbot.widgets.SWTBotShell;
import net.sf.swtbot.widgets.TimeoutException;
import net.sf.swtbot.widgets.WidgetNotFoundException;
public class test extends TestCase{
public void testProjectInvoke() throws WidgetNotFoundException{
SWTEclipseBot bot = new SWTEclipseBot();
bot.menu("File").menu("New").menu("Java Project").click();
try {
bot.shell("New Java Project").activate();
bot.textWithLabel("Project name:").setText("MyProject");
bot.button("Finish").click();
} catch (TimeoutException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
ran this as a Junit-Plugin Test
on running this target, a target Eclipse sdk.ide is launched, the wizard
shows up and hangs.
I tried to debug and it seems that it doesn't come out of line 212 in
AbstractSWTBot.java ( widget.notifyListeners(...) );
Any help is appreciated.
Also, I struggled to find some examples with testing Eclipse Plugins. It'd
be nice to have some test samples around on the wiki. I do not want to go
the record and play way but want to write tests just like i would write a
junit test.
Thanks in advance.
Somesh
|