Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » RCP Testing Tool » [SOLVED] RCPTT terminates execution if any assertion fails in a test case
[SOLVED] RCPTT terminates execution if any assertion fails in a test case [message #1691550] Wed, 08 April 2015 06:00 Go to next message
Sushanta Dasgupta is currently offline Sushanta DasguptaFriend
Messages: 6
Registered: April 2015
Junior Member
Hi,

I am very new to RCPTT.
I have a test case with multiple assertions. If any of those assertion fails, RCPTT does not execute the statements after that, it stops executing that test case there.
Is there any way to continue execution even if any assertion fails ?

Thanks in Advance
-- Sushant

[Updated on: Mon, 05 October 2015 06:33] by Moderator

Report message to a moderator

Re: RCPTT terminates execution if any assertion fails in a test case [message #1691694 is a reply to message #1691550] Thu, 09 April 2015 06:04 Go to previous messageGo to next message
Olga Yurchuk is currently offline Olga YurchukFriend
Messages: 245
Registered: September 2014
Senior Member

Hello,

RCPTT Test Case is considered as failed if there is a failed assertion. That's why it doesn't continue execution after the first failing.
As a workaround I may suggest you to use the following ECL construction:
<ECL commands>
global [val a1 [ <the first expression with the key -raw in get-property>]]
<ECL commands>
global [val a2 [ <the second expression with the key -raw in get-property> ]]
<ECL commands>
and [bool $a1] [bool $a2] | assert-true -message "There is a failed assertion"


  1. Record ECL script with all verifications
  2. Remove verify-true and add key -raw after get-property command (why?)
  3. Wrap asserted expression to global [val a2 [ ... ]]
  4. Add assertion to the end of the test case:
    and [bool $a1] [bool $a2] | assert-true -message "There is a failed assertion"


You can find more information about ECL commands here.
Please try and let me know if you have any questions.

I used the following snippet to test this approach:
log 1
global [val a1 [ get-editor test | get-section Contexts | get-label Contexts | get-property caption -raw | eq Contexts ]]
log 2
global [val a2 [ get-editor test | get-section Contexts | get-label Contexts | get-property caption -raw | eq Contexts ]]
log 3
and [bool $a1] [bool $a2] | assert-true -message "There is a failed assertion"


Yours sincerely,
Olga.
Re: RCPTT terminates execution if any assertion fails in a test case [message #1691713 is a reply to message #1691694] Thu, 09 April 2015 08:54 Go to previous messageGo to next message
Sushanta Dasgupta is currently offline Sushanta DasguptaFriend
Messages: 6
Registered: April 2015
Junior Member
Thanks Olga Yurchuk for your quick response. It really worked

I have one more doubt -
If I use the following ECL command --

and [bool $a1] [bool $a2] | assert-true -message "There is a failed assertion"

how would I know which of the asserted expressions has failed ?

In my test case I may have multiple asserted expressions, but if I use the assertion statement for all of them together, how would I know which all have failed and which all have passed ?

Thanks & Regards,
Sushant

[Updated on: Thu, 09 April 2015 08:55]

Report message to a moderator

Re: RCPTT terminates execution if any assertion fails in a test case [message #1691717 is a reply to message #1691713] Thu, 09 April 2015 09:32 Go to previous messageGo to next message
Olga Yurchuk is currently offline Olga YurchukFriend
Messages: 245
Registered: September 2014
Senior Member

Above ECL snippet fails if there are failed assertions, if all assertions passes, test passes.
You can change error message by changing value of key -message. Take a look at the following snippet:

and [bool $a1] [bool $a2] | assert-true -message [concat "assert1 " $a1 ", assert2 " $a2 ]



Yours sincerely,
Olga.
Re: RCPTT terminates execution if any assertion fails in a test case [message #1691727 is a reply to message #1691717] Thu, 09 April 2015 10:09 Go to previous message
Sushanta Dasgupta is currently offline Sushanta DasguptaFriend
Messages: 6
Registered: April 2015
Junior Member
Hey..it worked

Thanks for your quick support Smile
Previous Topic:Verification in Database
Next Topic:[SOLVED] Use of regular expression to detect widget
Goto Forum:
  


Current Time: Thu Apr 25 01:55:19 GMT 2024

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

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

Back to the top