Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » Can SWTBot work for me?
Can SWTBot work for me? [message #643964] Wed, 08 December 2010 20:22 Go to next message
Sharon Snyder is currently offline Sharon SnyderFriend
Messages: 56
Registered: September 2010
Member

Hi,

I am evaluating whether or not SWTBot will work in my environment. Let me explain what it is and what our tester would like to do. Please note that this is for system integration testing, not just unit testing.

Currently we have a python based framework that controls and runs tests (similar enough to a junit framework for you to get the idea). It will kick off, and send tcpip messages to various systems/components that all need to respond appropriately....(these tcpip messages may tell the individual applications to do things like login, logout, perform functionX, perform function Y - and each application sends a response that our framework evaluates).

My project is an Eclipse RCP application, the first one in use at my company....and we would like to use SWTBot to somehow allow us to fit into this "model".

Basically, from python: we want to kick off my application (get some response that it's started), run testX (i.e. login), get some kind of response that testX was success/fail, run testY, get some kind of response that testY was success/fail, etc. Note that I do not want to stop the application in between, but have the Python script determine which test it wants to run next (so it can also perform other tasks on the other applications at various times).

My application runs and depending upon actions by other applications it will display/do different things for the "user" to respond to. We want to continue to use our Python control script to make the action happen, check my new application that it displays the appropriate "change", initiate other changes by my application and other applications, etc.

So, my question is....can I keep my application running somewhere, and have the python script somehow run a test that runs on a specific instance of my application without having to stop/start my application each time? We would also like to run this headless if possible.

Is this possible?

Now I could bastardize the SWTBotTest and have one big test that run a message loop listening for the TCPIP messages....but I'd rather not do that if I don't have to, since I think that will make our testcases more difficult to maintain and re-use unit test cases in these integration tests will also be more difficult.

Thanks,
Sharon
Re: Can SWTBot work for me? [message #643970 is a reply to message #643964] Wed, 08 December 2010 20:50 Go to previous messageGo to next message
Ketan Padegaonkar is currently offline Ketan PadegaonkarFriend
Messages: 873
Registered: July 2009
Senior Member
I don't see any way to do this without bastardizing the swtbot test runner.

SWTBot can be launched headless from within your python framework.

The reason being your description where an swtbot test triggers a python
test which in turn triggers another swtbot test. This seems like an
antipattern with tests having cyclic dependencies that will couple your
tests to each other – leading to a nightmare in test maintainability and
debugging among other things. Not to mention having to maintain a
component that depends on swtbot and junit internals which may
(un?)likely change in the future.

If you're willing to relax this restriction you could have a case where
your swtbot tests run as regular tests, the tests click somewhere in
your RCP application, execute a python script to verify stuff in your
3rd party apps(fail if necessary) and move on to the next test. The
python script will not tell what test to run next, and the next test is
determined by the swtbot runner itself. This would make tests lot more
simple and decoupled from each other.

Does this answer your question ?

--
Ketan
ketan.padegaonkar.name | eclipse.org/swtbot | @ketanpkr

On 12/8/10 12:22 PM, Sharon Snyder wrote:
> Hi,
>
> I am evaluating whether or not SWTBot will work in my environment. Let
> me explain what it is and what our tester would like to do. Please note
> that this is for system integration testing, not just unit testing.
>
> Currently we have a python based framework that controls and runs tests
> (similar enough to a junit framework for you to get the idea). It will
> kick off, and send tcpip messages to various systems/components that all
> need to respond appropriately....(these tcpip messages may tell the
> individual applications to do things like login, logout, perform
> functionX, perform function Y - and each application sends a response
> that our framework evaluates).
>
> My project is an Eclipse RCP application, the first one in use at my
> company....and we would like to use SWTBot to somehow allow us to fit
> into this "model".
>
> Basically, from python: we want to kick off my application (get some
> response that it's started), run testX (i.e. login), get some kind of
> response that testX was success/fail, run testY, get some kind of
> response that testY was success/fail, etc. Note that I do not want to
> stop the application in between, but have the Python script determine
> which test it wants to run next (so it can also perform other tasks on
> the other applications at various times).
>
> My application runs and depending upon actions by other applications it
> will display/do different things for the "user" to respond to. We want
> to continue to use our Python control script to make the action happen,
> check my new application that it displays the appropriate "change",
> initiate other changes by my application and other applications, etc.
>
> So, my question is....can I keep my application running somewhere, and
> have the python script somehow run a test that runs on a specific
> instance of my application without having to stop/start my application
> each time? We would also like to run this headless if possible.
>
> Is this possible?
>
> Now I could bastardize the SWTBotTest and have one big test that run a
> message loop listening for the TCPIP messages....but I'd rather not do
> that if I don't have to, since I think that will make our testcases more
> difficult to maintain and re-use unit test cases in these integration
> tests will also be more difficult.
>
> Thanks,
> Sharon
Re: Can SWTBot work for me? [message #643973 is a reply to message #643970] Wed, 08 December 2010 20:58 Go to previous message
Sharon Snyder is currently offline Sharon SnyderFriend
Messages: 56
Registered: September 2010
Member

Hi Ketan,

Thanks so much...that is what I was afraid of. I have tried to convince our tester that we are fitting a square peg into a round hole with how he wants to do things....since "it's the way it's done now". Unfortunately, I have not convinced him that it's a bad idea!

His reasoning is that all the testers in our company know the "old" way, and if we get some help, he'd have to teach them a new way to do things. *sigh*

Thanks for your quick response....and wish me luck in changing his mind!

-Sharon
Previous Topic:SWTBotBrowser
Next Topic:Plugin dependencies
Goto Forum:
  


Current Time: Mon Nov 24 00:27:58 GMT 2014

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

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