Skip to main content



      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 02:00 Go to next message
Eclipse UserFriend
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 02:33] by 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 02:04 Go to previous messageGo to next message
Eclipse UserFriend
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"
Re: RCPTT terminates execution if any assertion fails in a test case [message #1691713 is a reply to message #1691694] Thu, 09 April 2015 04:54 Go to previous messageGo to next message
Eclipse UserFriend
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 04:55] by 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 05:32 Go to previous messageGo to next message
Eclipse UserFriend
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 ]

Re: RCPTT terminates execution if any assertion fails in a test case [message #1691727 is a reply to message #1691717] Thu, 09 April 2015 06:09 Go to previous message
Eclipse UserFriend
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: Mon Jun 23 12:47:19 EDT 2025

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

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

Back to the top