Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » Test Fails for consecutive test cases-SWTBot(Test Fails for consecutive test cases-SWTBot)
icon5.gif  Test Fails for consecutive test cases-SWTBot [message #735233] Tue, 11 October 2011 09:59 Go to next message
Vinod Kannur is currently offline Vinod KannurFriend
Messages: 7
Registered: October 2011
Junior Member
Hi,
I have a requirement to write test cases for SWT/UI Application for Eclipse plugin Framework.
I have tried with sample examples, but the test stops when test case fails and cannot execute later part of test code.
Can you please provide alternate method how I can test for all UI menus without stopping test case even if error happens. The error displayed should be clear enough so that I can view it in console.
I hope I am clear with my requirement.

I have tried the example for sample RCP Mail Template.
Sample code for SWTBot Testing should elaborate what I mean:

@Test
public void canCreateAMessage() throws Exception {

bot.menu("File").menu("Open Message").click();


bot.menu("File").menu("Dummy Message").click(); //When bot tries to find the dummy Message menu, it throws an error(though next line is also error but it doesnt show) and stop executing following codes of line.
/bot.viewByTitle(" New Message");
bot.viewById("org.rcpmail.navigationView");



// increase timeout to 10 seconds
SWTBotPreferences.TIMEOUT = 10000;

}


Can you please let me know whether how it can be achieved? Can we also write Test Suit for SWTBot?


Thanks in Advance!!!

Regards,
Vinod
Re: Test Fails for consecutive test cases-SWTBot [message #735505 is a reply to message #735233] Wed, 12 October 2011 03:43 Go to previous messageGo to next message
Madhu G is currently offline Madhu GFriend
Messages: 8
Registered: September 2011
Junior Member
You can use try and catch block to capture exception and to continue on remaining steps.
Re: Test Fails for consecutive test cases-SWTBot [message #735596 is a reply to message #735505] Wed, 12 October 2011 10:22 Go to previous messageGo to next message
Vinod Kannur is currently offline Vinod KannurFriend
Messages: 7
Registered: October 2011
Junior Member
Thanks for the reply Madhur. Smile
Is this the usual way to avoid the blocking the test case for SWTBot?
Isn't there any way apart from try and catch block to achieve the same just like JUnit executes?

Thanks,
Vinod
Re: Test Fails for consecutive test cases-SWTBot [message #736084 is a reply to message #735596] Thu, 13 October 2011 14:34 Go to previous message
Ketan Padegaonkar is currently offline Ketan PadegaonkarFriend
Messages: 873
Registered: July 2009
Senior Member
This is the default behavior with most programming languages. If
something that is unexpected happens, then the programmer needs to write
code to handle it, or do nothing which will cause the particular test to
break.

-- Ketan

On 10/12/11 3:22 AM, Vinod Kannur wrote:
> Thanks for the reply Madhur. :) Is this the usual way to avoid the
> blocking the test case for SWTBot?
> Isn't there any way apart from try and catch block to achieve the same
> just like JUnit executes?
>
> Thanks,
> Vinod
>
Previous Topic:Previous SWTBot versions in the p2 repo
Next Topic:multiple selections from tree + context menu
Goto Forum:
  


Current Time: Mon Nov 24 20:32:57 GMT 2014

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

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