Carlos Fontana
Katalon Apprentice
04/20/2018

Block finally doesn't run in katalon 5.4

## OS windows server 2012 r2
## Katalon Studio Version 5.4
## Katalon Studio logs:

note: the log was cleaned before starting the test to have only the log of this execution

## Steps to reproduce -



Upvote
Quote

Comments

  • David Klein
    Katalon Ambassador
    04/20/2018
    I have found the same thing.  We are relying on the finally block for a Mobile.closeApplication() which will uninstall the app (even if earlier steps fail) -- thus allowing the next test to start with a clean install.
    Upvote
    Quote
  • Vinh Nguyen
    Katalon Moderator
    04/23/2018
    Hi,

    We've noted down this issue and will fix it soon. Thanks for your information.

    Regards
    Upvote
    Quote
  • Carlos Fontana
    Katalon Apprentice
    04/23/2018
    Hi,

    We've noted down this issue and will fix it soon. Thanks for your information.

    Regards
    Meanwhile, do you have a link to download the version of katalon 5.3 or 5.3.1 for linux?
    Upvote
    Quote
  • David Klein
    Katalon Ambassador
    04/23/2018
    Thank you.
    Upvote
    Quote
  • Carlos Fontana
    Katalon Apprentice
    04/25/2018
    @Vinh Nguyen do you have a link to download the version of katalon 5.3 or 5.3.1 for linux?
    Upvote
    Quote
  • Carlos Fontana
    Katalon Apprentice
    05/04/2018
    edited May 4
    Hi,

    We've noted down this issue and will fix it soon. Thanks for your information.

    Regards
    @"Vinh Nguyen"  Do you have news about this fix?
    Upvote
    Quote
  • Vinh Nguyen
    Katalon Moderator
    05/07/2018
    This has been fixed in 5.4.1 version, can you please double check again on that version?
    Upvote
    Quote
  • Carlos Fontana
    Katalon Apprentice
    05/07/2018
    This has been fixed in 5.4.1 version, can you please double check again on that version?
    In Windows it is ok, but in the Linux version the error continues
    Upvote
    Quote
  • David Klein
    Katalon Ambassador
    05/07/2018
    @Vihn Nguyen -- The issue still persists on Mac, Version: 5.4.1, Build: 1.  But a huge thank you to your team for looking into this so promptly.

    Upvote
    Quote
  • Vinh Nguyen
    Katalon Moderator
    05/08/2018
    @Vihn Nguyen -- The issue still persists on Mac, Version: 5.4.1, Build: 1.  But a huge thank you to your team for looking into this so promptly.

    Hmm it's strange. Let me double check it again.
    Upvote
    Quote
  • Vinh Nguyen
    Katalon Moderator
    05/08/2018
    @Vihn Nguyen -- The issue still persists on Mac, Version: 5.4.1, Build: 1.  But a huge thank you to your team for looking into this so promptly.

    Well I've tried again on macOS version and see finally block does execute. Can you please double check again?

    Upvote
    Quote
  • Carlos Fontana
    Katalon Apprentice
    05/08/2018
    edited May 8
    This has been fixed in 5.4.1 version, can you please double check again on that version?
    In Windows it is ok, but in the Linux version the error continues
    @Vihn Nguyen  The issue still persists on Linux, Version: 5.4.1, Build: 1


    Upvote
    Quote
  • Carlos Fontana
    Katalon Apprentice
    05/10/2018
    @"Vinh Nguyen"  Do you have news about this fix for the linux version?
    Thank you very much to you and your team for all the work
    
    Upvote
    Quote
  • Vinh Nguyen
    Katalon Moderator
    05/10/2018
    @"Vinh Nguyen"  Do you have news about this fix for the linux version?
    Thank you very much to you and your team for all the work
    
    Hm it's strange because Linux version has the same code base. Are you sure 5.3 version of Linux edition works?
    Upvote
    Quote
  • Carlos Fontana
    Katalon Apprentice
    05/10/2018
    @"Vinh Nguyen"  Do you have news about this fix for the linux version?
    Thank you very much to you and your team for all the work
    
    Hm it's strange because Linux version has the same code base. Are you sure 5.3 version of Linux edition works?
    in 5.3 I do not know. But in 5.0 it works perfect.
    do you have a link to download version 5.3 (linux)?
    Upvote
    Quote
  • Carlos Fontana
    Katalon Apprentice
    05/10/2018
    @"Vinh Nguyen"  Do you have news about this fix for the linux version?
    Thank you very much to you and your team for all the work
    
    Hm it's strange because Linux version has the same code base. Are you sure 5.3 version of Linux edition works?
    just now download version 5.4.1 for Linux and the files have a modification date of 04/23/04 and Windows files have a modification date of 04-27-18.
    Upvote
    Quote
  • Carlos Fontana
    Katalon Apprentice
    05/14/2018
    @"Vinh Nguyen"  Do you have news about this fix for the linux version?
    Thank you very much to you and your team for all the work
    
    Hm it's strange because Linux version has the same code base. Are you sure 5.3 version of Linux edition works?
    in 5.3 I do not know. But in 5.0 it works perfect.
    do you have a link to download version 5.3 (linux)?
    @"Vinh Nguyen" You have news?

    Upvote
    Quote
  • David Klein
    Katalon Ambassador
    05/15/2018
    @Vihn Nguyen -- The issue still persists on Mac, Version: 5.4.1, Build: 1.  But a huge thank you to your team for looking into this so promptly.

    Well I've tried again on macOS version and see finally block does execute. Can you please double check again?


    I'm testing with Android Mobile.   Both successful TRY blocks  and failing TRY blocks fail to run the FINALLY blocks. 








    Upvote
    Quote
  • Vinh Nguyen
    Katalon Moderator
    05/16/2018
    I'm not sure what you mean here. Finally block does execute based on your provided information, so it do its expected behaviors. 
    Upvote
    Quote
  • Carlos Fontana
    Katalon Apprentice
    05/16/2018
    edited May 16
    I'm not sure what you mean here. Finally block does execute based on your provided information, so it do its expected behaviors. 

    This bug continues in the linux version
    I tried the latest version for Linux, whose source code was last modified on 04/23/04, while the Windows version was modified on 04/27/04, which makes me think that the Linux version does not has the solution
    Hugs
    Upvote
    Quote
  • David Klein
    Katalon Ambassador
    05/16/2018
    I'm not sure what you mean here. Finally block does execute based on your provided information, so it do its expected behaviors. 
    Thank you again for investigating.   We do appreciate the time and effort you put in to help us.

    In my snippets above, you can see that the FINALLY blocks of println('Inside FINALLY block') did not execute -- whether the TRY block succeeds or fails.  You also do not see the Katalonlog of Start action : Statement - Finally that is shown in your screengrab.

    In builds 5.3.1, Katalon followed the programming convention where the FINALLY block always executes -- If the TRY block succeeds, the FINALLY block executes.  If the TRY block fails, the exceptions are thrown and the FINALLY block still executes.  (Even when the FailureHandling is set to STOP_ON_FAILURE.)

    My reference for FINALLY -- https://docs.oracle.com/javase/tutorial/essential/exceptions/finally.html

    In the current 5.4.1 Build 1 of Katalon, on my Mac running Mobile test cases, the FINALLY block never runs.

    I use the FINALLY block to tear down and reset the device back to a "zero" or starting-state, which involves more than just uninstalling my app.  (I configure the settings and install/uninstall other apps and files, surf in Chrome, and other things.)

    To help debug, I replicated your script (without using Mobile keywords), and you can see below that the FINALLY block did not execute.  The JVM is still active, since the last println did write.




    Upvote
    Quote
  • Drunda Nibel
    Katalon Apprentice
    05/16/2018
    I also noticed yesterday with the current Windows version that the finally block was not running. I didn't have the code I was using right now, but in the end I was content to write down my final actions after the catch block, outside of a finally block - which even worked.

    By the way: What are the advantages of such a finally block, even if it seems to work (as I would expect) without it? Sorry for my ignorance, but I've never used this try-catch structure before.
    Upvote
    Quote
  • David Klein
    Katalon Ambassador
    05/16/2018
  • Drunda Nibel
    Katalon Apprentice
    05/16/2018
    Thanks David,
    great source that makes things clearer to me!
    Upvote
    Quote
  • Carlos Fontana
    Katalon Apprentice
    05/17/2018
    I also noticed yesterday with the current Windows version that the finally block was not running. I didn't have the code I was using right now, but in the end I was content to write down my final actions after the catch block, outside of a finally block - which even worked.

    By the way: What are the advantages of such a finally block, even if it seems to work (as I would expect) without it? Sorry for my ignorance, but I've never used this try-catch structure before.
    Hi
    In the Windows version, the finally block works perfectly, I've tested it downloading the latest version.
    But in the Linux version it does not work, neither on Mac like say David in his comments 

    regards
    Upvote
    Quote
  • Drunda Nibel
    Katalon Apprentice
    05/17/2018
    Hi Carlos,
    In the Windows version, the finally block works perfectly, I've tested it downloading the latest version.
    Have you even considered that there may be other special circumstances besides the operating system version that could make one thing look different to yours?

    I've just double checked it again. And believe it or not, for me it is still not working.

    Here is my code:
    try {
        println '### try ###'
    }
    catch (Exception e) {
        println '### catch ###'
    }
    finally {
        println '### finally ###'
    }
    println '### try-catch-finally finished ###'
    If no error occurs, I get this:
    05-17-2018 02:20:31 PM - [START]  - Start Test Case : Test Cases/test_finally
    05-17-2018 02:20:32 PM - [INFO]   - Evaluating variables for test case
    05-17-2018 02:20:34 PM - [START]  - Start action : Statement - Try
    05-17-2018 02:20:34 PM - [START]  - Start action : Statement - println("### try ###")
    ### try ###
    05-17-2018 02:20:34 PM - [END]    - End action : Statement - println("### try ###")
    05-17-2018 02:20:34 PM - [END]    - End action : Statement - Try
    05-17-2018 02:20:34 PM - [START]  - Start action : Statement - println("### try-catch-finally finished ###")
    ### try-catch-finally finished ###
    05-17-2018 02:20:34 PM - [END]    - End action : Statement - println("### try-catch-finally finished ###")
    05-17-2018 02:20:34 PM - [PASSED] - Test Cases/test_finally
    05-17-2018 02:20:34 PM - [END]    - End Test Case : Test Cases/test_finally
    Where do you see the finally block?

    Almost the same in case of an error, where only the catch block appears additionally as expected.

    I am using the 64bit version of Katalon Studio 5.4.1 on Windows 10, which itself pretends to be the very latest.

    Best regards
    Upvote
    Quote
  • Carlos Fontana
    Katalon Apprentice
    05/17/2018
    hi @"Drunda Nibel"
    I use Windows server 2012 r2, katalon 5.4.1 downdload May 7



    @"Vinh Nguyen" in Linux still fails

    Upvote
    Quote
  • Carlos Fontana
    Katalon Apprentice
    05/22/2018
    @"Vinh Nguyen" excuse the insistence, do you have any news about this fix for the linux version?
    Upvote
    Quote
  • Drunda Nibel
    Katalon Apprentice
    05/22/2018
    Carlos, why again only for the Linux version?? So that this doesn't go down: The problem also occurs with the Windows version (under certain circumstances). See my posts above.

    And for the record: I would also be interested in a solution. :) Thanks.

    Upvote
    Quote
Sign In or Register to comment.