Forum Discussion

fayrehouse's avatar
fayrehouse
Frequent Contributor
11 years ago

Stop on Error.... different levels?

Hi All,



Can anyone suggest how I can achieve this...



I have a number of keyword tests, each consisting of a number of script routine calls. those routine's may have Log.Errors in. 



Obviously, with Stop on error set, this would stop the current keyword test in it's tracks.





However, going forward, we will be calling TC (or TestExecute) from the command line to run multiple KW tests. To save time in terms of starting / executing TC/TE, it seems logical to me to create a keyword test "suite" - consisting of a Keyword test that contains all the tests we wish to run - and simply point the command line at this single KW test "suite".



In this scenario, I would want a script module Log.Error to fail the parent KW test, but NOT the entire KW "suite".



Any thoughts?





  • 1. By specifying just the project at the command line, will it ONLY try to run the KW tests, or will it also try and execute anything in the Script Folder(s)?

    A: It only runs the KW tests you "drag" into the project test items (double-clickon the project icon/name on the Project Explorer)



    2. If in TC, we have a folder hierarchy of KW tests (eg, Login tests, Logout tests, blah blah blah) - what if we only wanted to run the Login tests - the command line does not accept folder names - eg KeywordTests|01_NormalLogin  as opposed to KeywordTests|LoginTests|01_NormalLogin. Would there be a way to select a subset of KW tests using your suggestion?

    A: I already  sent a support ticket to smartbear regarding the organization of the test items, now you can only drag n' drop one KW/Script at a time, it would be awesome if it was possible to drag full folders. 

    If you want to have different Project files to different iterations, you can create as many mds files as you want, give it different names and in a bash go through them running one at a time. Problably you'll need to change the name as you go, but maybe it can work with different names...
  • jose_pita's avatar
    jose_pita
    Super Contributor
    1. By specifying just the project at the command line, will it ONLY try to run the KW tests, or will it also try and execute anything in the Script Folder(s)?

    A: It only runs the KW tests you "drag" into the project test items (double-clickon the project icon/name on the Project Explorer)



    2. If in TC, we have a folder hierarchy of KW tests (eg, Login tests, Logout tests, blah blah blah) - what if we only wanted to run the Login tests - the command line does not accept folder names - eg KeywordTests|01_NormalLogin  as opposed to KeywordTests|LoginTests|01_NormalLogin. Would there be a way to select a subset of KW tests using your suggestion?

    A: I already  sent a support ticket to smartbear regarding the organization of the test items, now you can only drag n' drop one KW/Script at a time, it would be awesome if it was possible to drag full folders. 

    If you want to have different Project files to different iterations, you can create as many mds files as you want, give it different names and in a bash go through them running one at a time. Problably you'll need to change the name as you go, but maybe it can work with different names...
  • jose_pita's avatar
    jose_pita
    Super Contributor
    Running the project instead of a KW is not an option? With all your tests inside?



    Then when you call the Log.Error, on the OnLogError event you can use Runner.Stop(true); to stop the test and continue to the next one...



    If this is helpful and you need more detail, feel free to ask, otherwise, good luck!
  • fayrehouse's avatar
    fayrehouse
    Frequent Contributor
    Hi Jose,



    Thanks for that - a good option indeed. 2 questions / observations:



    1. By specifying just the project at the command line, will it ONLY try to run the KW tests, or will it also try and execute anything in the Script Folder(s)?



    2. If in TC, we have a folder hierarchy of KW tests (eg, Login tests, Logout tests, blah blah blah) - what if we only wanted to run the Login tests - the command line does not accept folder names - eg KeywordTests|01_NormalLogin  as opposed to KeywordTests|LoginTests|01_NormalLogin. Would there be a way to select a subset of KW tests using your suggestion?



    Many thanks!



    Steve