Loading ...
Sorry, an error occurred while loading the content.

Re: [LoadRunner] Forcing an Iteration to Fail

Expand Messages
  • Kiran
    I am not sure if there is any function in LR which has return code as 0 and 4,I have seen and used only 2 return codes values and those are 0 for pass and 1
    Message 1 of 12 , Mar 1, 2009
    • 0 Attachment
      I am not sure if there is any function in LR which has return code as 0 and 4,I have seen and used only 2 return codes values and those are 0 for pass and 1 for fail or it could be vice versa.
      well I am not sure what do you mean by iteration failure,if your code says that it has exit iteration based on failure condition,then it has to exit.Maybe you might seeing End action as pass in your test results.
      Any ways, here is suggestion you should do to debug your code,
      first make sure that your conditions are working correctly,do not exit the iteration even it fails.
       
      once you know that your code is working correctly,then add exit on failure clause with iteration.I dont remember the function but its one line function,just keep it beneath lr_fail transaction and once your condition is met,i.e transaction fails ,it will exit the iteration.
       
      It happens sometimes,you just need to have some more patience while you are dealing with code,frustation and getting panic are one of the worst behaviour that affects the creative mind.
       
      if still you cannot do it,assume that either transaction is passing or your logic is faulty and finally you can also paste the code here,I am assuming that you have condition where in iteration exits only for failure and not for success.

      --- On Sat, 28/2/09, Stevenson Randy <StevensonRandalJ@...> wrote:

      From: Stevenson Randy <StevensonRandalJ@...>
      Subject: [LoadRunner] Forcing an Iteration to Fail
      To: "'LoadRunner@yahoogroups.com'" <LoadRunner@yahoogroups.com>
      Date: Saturday, 28 February, 2009, 3:59 AM






      Do you ever have those moments when you have used LoadRunner for over 8 years and you cannot for your life remember how to do something simple? Well, I seem to be having one of those moments.

      I am trying to test for use case success by testing for the return code from one of my transactions. If the return code is 0 or 4, the transaction passes. If the return code returns anything else, the transaction, and, more importantly, the iteration fails.

      I have now successfully built some spaghetti code that issues the error "Search failed" and says "Transaction "Check" ended with "Fail" status", but the Iteration shows as a success when I view the Test results...

      This has to be very simple, but what am I forgetting? (and, no, I do not have Continue on Error activated)

      Arghhh...

      Randy Stevenson
      Data & Application Services - Performance Testing Team
      Infrastructure Analyst
      Deere & Company
      1 John Deere Place
      WOB 2NW
      Moline, IL 61265
      (309) 765-0983
      Cell: (309) 737-6385
      StevensonRandy@ JohnDeere. com<mailto:StevensonRandy@ JohnDeere. com>

      "Why is there never enough time to do things right, but always enough time to do them over?"

      [Non-text portions of this message have been removed]

















      Check out the all-new Messenger 9.0! Go to http://in.messenger.yahoo.com/

      [Non-text portions of this message have been removed]
    • Stevenson Randy
      Perhaps I was not as clear as I could have been in my description of my problem. I have a web_submit_form action function in my script for which I am trying to
      Message 2 of 12 , Mar 1, 2009
      • 0 Attachment
        Perhaps I was not as clear as I could have been in my description of my problem. I have a web_submit_form action function in my script for which I am trying to verify success or failure. It is not possible to simply use a web_reg_find statement to check the return because there are two types of successful return codes sent back from the application: "getReturn code=0" or "getReturn code=4". So, here is what I have right now:

        int iRC_0, RC_4, iSuccess;

        web_reg_save_param("RC_Check_0",
        "LB=getReturnCode",
        "RB=0\n",
        "Ord=All",
        "NotFound=warning",
        LAST);

        web_reg_save_param("RC_Check_4",
        "LB=getReturnCode",
        "RB=4\n",
        "Ord=All",
        "NotFound=warning",
        LAST);

        web_submit_data("CKCWSv12TestServlet",
        .....
        .....
        .....

        iRC_0=atoi(lr_eval_string("{RC_Check_0_count}"));

        iRC_4=atoi(lr_eval_string("{RC_Check_4_count}"));

        if (iRC_0 == 1) {
        lr_vuser_status_message( "Here I am - 0");
        iSuccess=1;
        }

        if (iRC_4 == 1) {
        lr_vuser_status_message( "Here I am - 4");
        iSuccess=1;
        }

        if (iSuccess==0) {

        lr_fail_trans_with_error("web_submit_data failed");
        lr_end_transaction("01_04_CKC_ClickOn_Enter_SearchWithLastName",LR_AUTO);
        return;

        }else{

        lr_end_transaction("01_04_CKC_ClickOn_Enter_SearchWithLastName",LR_AUTO);

        }
        As I already conceded, spaghetti code...

        Anyway, if the function finds a return code of 0 or 4, it succeeds as it is supposed to. However, if it does not get a return code 0 or 4, I see this in the Playback Log:

        Action.c(114): Error: Search failed
        Action.c(116): Notify: Transaction "01_04_CKC_ClickOn_Enter_SearchWithLastName" ended with "Fail" status (Duration: 0.3203 Wasted Time: 0.0000).
        Ending action Action.
        Ending iteration 3.

        But in the "View --> Test Results", all Transactions show as "Passed". So how can that be? And what do I have to do to make the Iteration fail. My Test Results should look like this for the first 10 iterations:

        Passed
        Passed
        Failed
        Passed
        Failed
        Passed
        Passed
        Passed
        Failed
        Failed

        Randy Stevenson
        Data & Application Services - Performance Testing Team
        Infrastructure Analyst
        Deere & Company
        1 John Deere Place
        WOB 2NW
        Moline, IL 61265
        (309) 765-0983
        Cell: (309) 737-6385
        StevensonRandy@...<mailto:StevensonRandy@...>

        "Why is there never enough time to do things right, but always enough time to do them over?"



        ________________________________
        From: LoadRunner@yahoogroups.com [mailto:LoadRunner@yahoogroups.com] On Behalf Of Kiran
        Sent: Sunday, March 01, 2009 12:59 PM
        To: LoadRunner@yahoogroups.com
        Subject: Re: [LoadRunner] Forcing an Iteration to Fail


        I am not sure if there is any function in LR which has return code as 0 and 4,I have seen and used only 2 return codes values and those are 0 for pass and 1 for fail or it could be vice versa.
        well I am not sure what do you mean by iteration failure,if your code says that it has exit iteration based on failure condition,then it has to exit.Maybe you might seeing End action as pass in your test results.
        Any ways, here is suggestion you should do to debug your code,
        first make sure that your conditions are working correctly,do not exit the iteration even it fails.

        once you know that your code is working correctly,then add exit on failure clause with iteration.I dont remember the function but its one line function,just keep it beneath lr_fail transaction and once your condition is met,i.e transaction fails ,it will exit the iteration.

        It happens sometimes,you just need to have some more patience while you are dealing with code,frustation and getting panic are one of the worst behaviour that affects the creative mind.

        if still you cannot do it,assume that either transaction is passing or your logic is faulty and finally you can also paste the code here,I am assuming that you have condition where in iteration exits only for failure and not for success.

        --- On Sat, 28/2/09, Stevenson Randy <StevensonRandalJ@...<mailto:StevensonRandalJ%40JohnDeere.com>> wrote:

        From: Stevenson Randy <StevensonRandalJ@...<mailto:StevensonRandalJ%40JohnDeere.com>>
        Subject: [LoadRunner] Forcing an Iteration to Fail
        To: "'LoadRunner@yahoogroups.com<mailto:%27LoadRunner%40yahoogroups.com>'" <LoadRunner@yahoogroups.com<mailto:LoadRunner%40yahoogroups.com>>
        Date: Saturday, 28 February, 2009, 3:59 AM

        Do you ever have those moments when you have used LoadRunner for over 8 years and you cannot for your life remember how to do something simple? Well, I seem to be having one of those moments.

        I am trying to test for use case success by testing for the return code from one of my transactions. If the return code is 0 or 4, the transaction passes. If the return code returns anything else, the transaction, and, more importantly, the iteration fails.

        I have now successfully built some spaghetti code that issues the error "Search failed" and says "Transaction "Check" ended with "Fail" status", but the Iteration shows as a success when I view the Test results...

        This has to be very simple, but what am I forgetting? (and, no, I do not have Continue on Error activated)

        Arghhh...

        Randy Stevenson
        Data & Application Services - Performance Testing Team
        Infrastructure Analyst
        Deere & Company
        1 John Deere Place
        WOB 2NW
        Moline, IL 61265
        (309) 765-0983
        Cell: (309) 737-6385
        StevensonRandy@ JohnDeere. com<mailto:StevensonRandy@ JohnDeere. com>

        "Why is there never enough time to do things right, but always enough time to do them over?"

        [Non-text portions of this message have been removed]

        Check out the all-new Messenger 9.0! Go to http://in.messenger.yahoo.com/

        [Non-text portions of this message have been removed]





        [Non-text portions of this message have been removed]
      • Omkarnath P
        Try giving LR_FAIL in you lr_end_transaction as given below: if (iSuccess==0) { lr_fail_trans_with_error( web_submit_data failed );
        Message 3 of 12 , Mar 1, 2009
        • 0 Attachment
          Try giving "LR_FAIL" in you "lr_end_transaction" as given below:

          if (iSuccess==0) {
          lr_fail_trans_with_error("web_submit_data failed");
          lr_end_transaction("01_04_CKC_ClickOn_Enter_SearchWithLastName",LR_FAIL);
          return;
          }








          --- In LoadRunner@yahoogroups.com, Stevenson Randy
          <StevensonRandalJ@...> wrote:
          >
          > Perhaps I was not as clear as I could have been in my description of
          my problem. I have a web_submit_form action function in my script for
          which I am trying to verify success or failure. It is not possible to
          simply use a web_reg_find statement to check the return because there
          are two types of successful return codes sent back from the
          application: "getReturn code=0" or "getReturn code=4". So, here is
          what I have right now:
          >
          > int iRC_0, RC_4, iSuccess;
          >
          > web_reg_save_param("RC_Check_0",
          > "LB=getReturnCode",
          > "RB=0\n",
          > "Ord=All",
          > "NotFound=warning",
          > LAST);
          >
          > web_reg_save_param("RC_Check_4",
          > "LB=getReturnCode",
          > "RB=4\n",
          > "Ord=All",
          > "NotFound=warning",
          > LAST);
          >
          > web_submit_data("CKCWSv12TestServlet",
          > .....
          > .....
          > .....
          >
          > iRC_0=atoi(lr_eval_string("{RC_Check_0_count}"));
          >
          > iRC_4=atoi(lr_eval_string("{RC_Check_4_count}"));
          >
          > if (iRC_0 == 1) {
          > lr_vuser_status_message( "Here I am - 0");
          > iSuccess=1;
          > }
          >
          > if (iRC_4 == 1) {
          > lr_vuser_status_message( "Here I am - 4");
          > iSuccess=1;
          > }
          >
          > if (iSuccess==0) {
          >
          > lr_fail_trans_with_error("web_submit_data failed");
          >
          lr_end_transaction("01_04_CKC_ClickOn_Enter_SearchWithLastName",LR_AUTO);
          > return;
          >
          > }else{
          >
          >
          lr_end_transaction("01_04_CKC_ClickOn_Enter_SearchWithLastName",LR_AUTO);
          >
          > }
          > As I already conceded, spaghetti code...
          >
          > Anyway, if the function finds a return code of 0 or 4, it succeeds
          as it is supposed to. However, if it does not get a return code 0 or
          4, I see this in the Playback Log:
          >
          > Action.c(114): Error: Search failed
          > Action.c(116): Notify: Transaction
          "01_04_CKC_ClickOn_Enter_SearchWithLastName" ended with "Fail" status
          (Duration: 0.3203 Wasted Time: 0.0000).
          > Ending action Action.
          > Ending iteration 3.
          >
          > But in the "View --> Test Results", all Transactions show as
          "Passed". So how can that be? And what do I have to do to make the
          Iteration fail. My Test Results should look like this for the first 10
          iterations:
          >
          > Passed
          > Passed
          > Failed
          > Passed
          > Failed
          > Passed
          > Passed
          > Passed
          > Failed
          > Failed
          >
          > Randy Stevenson
          > Data & Application Services - Performance Testing Team
          > Infrastructure Analyst
          > Deere & Company
          > 1 John Deere Place
          > WOB 2NW
          > Moline, IL 61265
          > (309) 765-0983
          > Cell: (309) 737-6385
          > StevensonRandy@...<mailto:StevensonRandy@...>
          >
          > "Why is there never enough time to do things right, but always
          enough time to do them over?"
          >
          >
          >
          > ________________________________
          > From: LoadRunner@yahoogroups.com [mailto:LoadRunner@yahoogroups.com]
          On Behalf Of Kiran
          > Sent: Sunday, March 01, 2009 12:59 PM
          > To: LoadRunner@yahoogroups.com
          > Subject: Re: [LoadRunner] Forcing an Iteration to Fail
          >
          >
          > I am not sure if there is any function in LR which has return code
          as 0 and 4,I have seen and used only 2 return codes values and those
          are 0 for pass and 1 for fail or it could be vice versa.
          > well I am not sure what do you mean by iteration failure,if your
          code says that it has exit iteration based on failure condition,then
          it has to exit.Maybe you might seeing End action as pass in your test
          results.
          > Any ways, here is suggestion you should do to debug your code,
          > first make sure that your conditions are working correctly,do not
          exit the iteration even it fails.
          >
          > once you know that your code is working correctly,then add exit on
          failure clause with iteration.I dont remember the function but its one
          line function,just keep it beneath lr_fail transaction and once your
          condition is met,i.e transaction fails ,it will exit the iteration.
          >
          > It happens sometimes,you just need to have some more patience while
          you are dealing with code,frustation and getting panic are one of the
          worst behaviour that affects the creative mind.
          >
          > if still you cannot do it,assume that either transaction is passing
          or your logic is faulty and finally you can also paste the code here,I
          am assuming that you have condition where in iteration exits only for
          failure and not for success.
          >
          > --- On Sat, 28/2/09, Stevenson Randy
          <StevensonRandalJ@...<mailto:StevensonRandalJ%40JohnDeere.com>> wrote:
          >
          > From: Stevenson Randy
          <StevensonRandalJ@...<mailto:StevensonRandalJ%40JohnDeere.com>>
          > Subject: [LoadRunner] Forcing an Iteration to Fail
          > To:
          "'LoadRunner@yahoogroups.com<mailto:%27LoadRunner%40yahoogroups.com>'"
          <LoadRunner@yahoogroups.com<mailto:LoadRunner%40yahoogroups.com>>
          > Date: Saturday, 28 February, 2009, 3:59 AM
          >
          > Do you ever have those moments when you have used LoadRunner for
          over 8 years and you cannot for your life remember how to do something
          simple? Well, I seem to be having one of those moments.
          >
          > I am trying to test for use case success by testing for the return
          code from one of my transactions. If the return code is 0 or 4, the
          transaction passes. If the return code returns anything else, the
          transaction, and, more importantly, the iteration fails.
          >
          > I have now successfully built some spaghetti code that issues the
          error "Search failed" and says "Transaction "Check" ended with "Fail"
          status", but the Iteration shows as a success when I view the Test
          results...
          >
          > This has to be very simple, but what am I forgetting? (and, no, I do
          not have Continue on Error activated)
          >
          > Arghhh...
          >
          > Randy Stevenson
          > Data & Application Services - Performance Testing Team
          > Infrastructure Analyst
          > Deere & Company
          > 1 John Deere Place
          > WOB 2NW
          > Moline, IL 61265
          > (309) 765-0983
          > Cell: (309) 737-6385
          > StevensonRandy@ JohnDeere. com<mailto:StevensonRandy@ JohnDeere. com>
          >
          > "Why is there never enough time to do things right, but always
          enough time to do them over?"
          >
          > [Non-text portions of this message have been removed]
          >
          > Check out the all-new Messenger 9.0! Go to
          http://in.messenger.yahoo.com/
          >
          > [Non-text portions of this message have been removed]
          >
          >
          >
          >
          >
          > [Non-text portions of this message have been removed]
          >
        • corey bailey
          The vugen test results are inaccurate . I remember because I had to write a lot of custom code to make it accurate when service test first came out. Verify
          Message 4 of 12 , Mar 2, 2009
          • 0 Attachment
            The vugen test results are inaccurate . I remember because I had to write a lot of custom code to make it accurate when service test first came out. Verify in the controller not vugen.

            Sent with Wireless Sync from Verizon Wireless

            ---- Original Message ----
            From: "Stevenson Randy" <StevensonRandalJ@...>
            Date: 3/2/09 12:43 am
            To: "'LoadRunner@yahoogroups.com'" <LoadRunner@yahoogroups.com>
            Subj: RE: [LoadRunner] Forcing an Iteration to Fail
            Perhaps I was not as clear as I could have been in my description of my problem. I have a web_submit_form action function in my script for which I am trying to verify success or failure. It is not possible to simply use a web_reg_find statement to check the return because there are two types of successful return codes sent back from the application: "getReturn code=0" or "getReturn code=4". So, here is what I have right now:

            int iRC_0, RC_4, iSuccess;

            web_reg_save_param("RC_Check_0",
            "LB=getReturnCode",
            "RB=0\n",
            "Ord=All",
            "NotFound=warning",
            LAST);

            web_reg_save_param("RC_Check_4",
            "LB=getReturnCode",
            "RB=4\n",
            "Ord=All",
            "NotFound=warning",
            LAST);

            web_submit_data("CKCWSv12TestServlet",
            .....
            .....
            .....

            iRC_0=atoi(lr_eval_string("{RC_Check_0_count}"));

            iRC_4=atoi(lr_eval_string("{RC_Check_4_count}"));

            if (iRC_0 == 1) {
            lr_vuser_status_message( "Here I am - 0");
            iSuccess=1;
            }

            if (iRC_4 == 1) {
            lr_vuser_status_message( "Here I am - 4");
            iSuccess=1;
            }

            if (iSuccess==0) {

            lr_fail_trans_with_error("web_submit_data failed");
            lr_end_transaction("01_04_CKC_ClickOn_Enter_SearchWithLastName",LR_AUTO);
            return;

            }else{

            lr_end_transaction("01_04_CKC_ClickOn_Enter_SearchWithLastName",LR_AUTO);

            }
            As I already conceded, spaghetti code...

            Anyway, if the function finds a return code of 0 or 4, it succeeds as it is supposed to. However, if it does not get a return code 0 or 4, I see this in the Playback Log:

            Action.c(114): Error: Search failed
            Action.c(116): Notify: Transaction "01_04_CKC_ClickOn_Enter_SearchWithLastName" ended with "Fail" status (Duration: 0.3203 Wasted Time: 0.0000).
            Ending action Action.
            Ending iteration 3.

            But in the "View --> Test Results", all Transactions show as "Passed". So how can that be? And what do I have to do to make the Iteration fail. My Test Results should look like this for the first 10 iterations:

            Passed
            Passed
            Failed
            Passed
            Failed
            Passed
            Passed
            Passed
            Failed
            Failed

            Randy Stevenson
            Data & Application Services - Performance Testing Team
            Infrastructure Analyst
            Deere & Company
            1 John Deere Place
            WOB 2NW
            Moline, IL 61265
            (309) 765-0983
            Cell: (309) 737-6385
            StevensonRandy@...<mailto:StevensonRandy@...>

            "Why is there never enough time to do things right, but always enough time to do them over?"



            ________________________________
            From: LoadRunner@yahoogroups.com [mailto:LoadRunner@yahoogroups.com] On Behalf Of Kiran
            Sent: Sunday, March 01, 2009 12:59 PM
            To: LoadRunner@yahoogroups.com
            Subject: Re: [LoadRunner] Forcing an Iteration to Fail


            I am not sure if there is any function in LR which has return code as 0 and 4,I have seen and used only 2 return codes values and those are 0 for pass and 1 for fail or it could be vice versa.
            well I am not sure what do you mean by iteration failure,if your code says that it has exit iteration based on failure condition,then it has to exit.Maybe you might seeing End action as pass in your test results.
            Any ways, here is suggestion you should do to debug your code,
            first make sure that your conditions are working correctly,do not exit the iteration even it fails.

            once you know that your code is working correctly,then add exit on failure clause with iteration.I dont remember the function but its one line function,just keep it beneath lr_fail transaction and once your condition is met,i.e transaction fails ,it will exit the iteration.

            It happens sometimes,you just need to have some more patience while you are dealing with code,frustation and getting panic are one of the worst behaviour that affects the creative mind.

            if still you cannot do it,assume that either transaction is passing or your logic is faulty and finally you can also paste the code here,I am assuming that you have condition where in iteration exits only for failure and not for success.

            --- On Sat, 28/2/09, Stevenson Randy <StevensonRandalJ@...<mailto:StevensonRandalJ%40JohnDeere.com>> wrote:

            From: Stevenson Randy <StevensonRandalJ@...<mailto:StevensonRandalJ%40JohnDeere.com>>
            Subject: [LoadRunner] Forcing an Iteration to Fail
            To: "'LoadRunner@yahoogroups.com<mailto:%27LoadRunner%40yahoogroups.com>'" <LoadRunner@yahoogroups.com<mailto:LoadRunner%40yahoogroups.com>>
            Date: Saturday, 28 February, 2009, 3:59 AM

            Do you ever have those moments when you have used LoadRunner for over 8 years and you cannot for your life remember how to do something simple? Well, I seem to be having one of those moments.

            I am trying to test for use case success by testing for the return code from one of my transactions. If the return code is 0 or 4, the transaction passes. If the return code returns anything else, the transaction, and, more importantly, the iteration fails.

            I have now successfully built some spaghetti code that issues the error "Search failed" and says "Transaction "Check" ended with "Fail" status", but the Iteration shows as a success when I view the Test results...

            This has to be very simple, but what am I forgetting? (and, no, I do not have Continue on Error activated)

            Arghhh...

            Randy Stevenson
            Data & Application Services - Performance Testing Team
            Infrastructure Analyst
            Deere & Company
            1 John Deere Place
            WOB 2NW
            Moline, IL 61265
            (309) 765-0983
            Cell: (309) 737-6385
            StevensonRandy@ JohnDeere. com<mailto:StevensonRandy@ JohnDeere. com>

            "Why is there never enough time to do things right, but always enough time to do them over?"

            [Non-text portions of this message have been removed]

            Check out the all-new Messenger 9.0! Go to http://in.messenger.yahoo.com/

            [Non-text portions of this message have been removed]





            [Non-text portions of this message have been removed]
          • Kiran
            Assuming that getReturn code=0 or getReturn code=4 . remains static for entire duration of tests, you can also WRSP Return code in place of WRF. INT
            Message 5 of 12 , Mar 2, 2009
            • 0 Attachment
              Assuming that "getReturn code=0" or "getReturn code=4". remains static for entire duration of tests,
              you can also WRSP Return code in place of WRF.
              INT WRF1,INT WRF2,int z ;
              WRF1= WEB_REG_FIND( YOUR RC_CHECK_01);
              WRF1= WEB_REG_FIND(YOUR RC_CHECK_04);
               z= web_submit_data( "CKCWSv12TestSer vlet",);
              IF (WRF1==0&&WRF2==1)//wrf1 passess and WRF2 Fails
              lr_vuser_status_ message( "I AM AT RC_CHECK_01");
              ELSE
              lr_vuser_status_ message( "I AM AT RC_CHECK_04");
              if (Z==1);
              lr_exit_tranasction ();

              --- On Mon, 2/3/09, Stevenson Randy <StevensonRandalJ@...> wrote:

              From: Stevenson Randy <StevensonRandalJ@...>
              Subject: RE: [LoadRunner] Forcing an Iteration to Fail
              To: "'LoadRunner@yahoogroups.com'" <LoadRunner@yahoogroups.com>
              Date: Monday, 2 March, 2009, 11:13 AM






              Perhaps I was not as clear as I could have been in my description of my problem. I have a web_submit_form action function in my script for which I am trying to verify success or failure. It is not possible to simply use a web_reg_find statement to check the return because there are two types of successful return codes sent back from the application: "getReturn code=0" or "getReturn code=4". So, here is what I have right now:

              int iRC_0, RC_4, iSuccess;

              web_reg_save_ param("RC_ Check_0",
              "LB=getReturnCode" ,
              "RB=0\n",
              "Ord=All",
              "NotFound=warning" ,
              LAST);

              web_reg_save_ param("RC_ Check_4",
              "LB=getReturnCode" ,
              "RB=4\n",
              "Ord=All",
              "NotFound=warning" ,
              LAST);

              web_submit_data( "CKCWSv12TestSer vlet",
              .....
              .....
              .....

              iRC_0=atoi(lr_ eval_string( "{RC_Check_ 0_count}" ));

              iRC_4=atoi(lr_ eval_string( "{RC_Check_ 4_count}" ));

              if (iRC_0 == 1) {
              lr_vuser_status_ message( "Here I am - 0");
              iSuccess=1;
              }

              if (iRC_4 == 1) {
              lr_vuser_status_ message( "Here I am - 4");
              iSuccess=1;
              }

              if (iSuccess==0) {

              lr_fail_trans_ with_error( "web_submit_ data failed");
              lr_end_transaction( "01_04_CKC_ ClickOn_Enter_ SearchWithLastNa me",LR_AUTO) ;
              return;

              }else{

              lr_end_transaction( "01_04_CKC_ ClickOn_Enter_ SearchWithLastNa me",LR_AUTO) ;

              }
              As I already conceded, spaghetti code...

              Anyway, if the function finds a return code of 0 or 4, it succeeds as it is supposed to. However, if it does not get a return code 0 or 4, I see this in the Playback Log:

              Action.c(114) : Error: Search failed
              Action.c(116) : Notify: Transaction "01_04_CKC_ClickOn_ Enter_SearchWith LastName" ended with "Fail" status (Duration: 0.3203 Wasted Time: 0.0000).
              Ending action Action.
              Ending iteration 3.

              But in the "View --> Test Results", all Transactions show as "Passed". So how can that be? And what do I have to do to make the Iteration fail. My Test Results should look like this for the first 10 iterations:

              Passed
              Passed
              Failed
              Passed
              Failed
              Passed
              Passed
              Passed
              Failed
              Failed

              Randy Stevenson
              Data & Application Services - Performance Testing Team
              Infrastructure Analyst
              Deere & Company
              1 John Deere Place
              WOB 2NW
              Moline, IL 61265
              (309) 765-0983
              Cell: (309) 737-6385
              StevensonRandy@ JohnDeere. com<mailto:StevensonRandy@ JohnDeere. com>

              "Why is there never enough time to do things right, but always enough time to do them over?"

              ____________ _________ _________ __
              From: LoadRunner@yahoogro ups.com [mailto:LoadRunner@yahoogro ups.com] On Behalf Of Kiran
              Sent: Sunday, March 01, 2009 12:59 PM
              To: LoadRunner@yahoogro ups.com
              Subject: Re: [LoadRunner] Forcing an Iteration to Fail

              I am not sure if there is any function in LR which has return code as 0 and 4,I have seen and used only 2 return codes values and those are 0 for pass and 1 for fail or it could be vice versa.
              well I am not sure what do you mean by iteration failure,if your code says that it has exit iteration based on failure condition,then it has to exit.Maybe you might seeing End action as pass in your test results.
              Any ways, here is suggestion you should do to debug your code,
              first make sure that your conditions are working correctly,do not exit the iteration even it fails.

              once you know that your code is working correctly,then add exit on failure clause with iteration.I dont remember the function but its one line function,just keep it beneath lr_fail transaction and once your condition is met,i.e transaction fails ,it will exit the iteration.

              It happens sometimes,you just need to have some more patience while you are dealing with code,frustation and getting panic are one of the worst behaviour that affects the creative mind.

              if still you cannot do it,assume that either transaction is passing or your logic is faulty and finally you can also paste the code here,I am assuming that you have condition where in iteration exits only for failure and not for success.

              --- On Sat, 28/2/09, Stevenson Randy <StevensonRandalJ@ JohnDeere. com<mailto:StevensonRa ndalJ%40JohnDeer e.com>> wrote:

              From: Stevenson Randy <StevensonRandalJ@ JohnDeere. com<mailto:StevensonRa ndalJ%40JohnDeer e.com>>
              Subject: [LoadRunner] Forcing an Iteration to Fail
              To: "'LoadRunner@ yahoogroups. com<mailto:%27LoadRunn er%40yahoogroups .com>'" <LoadRunner@yahoogro ups.com<mailto:LoadRunner% 40yahoogroups. com>>
              Date: Saturday, 28 February, 2009, 3:59 AM

              Do you ever have those moments when you have used LoadRunner for over 8 years and you cannot for your life remember how to do something simple? Well, I seem to be having one of those moments.

              I am trying to test for use case success by testing for the return code from one of my transactions. If the return code is 0 or 4, the transaction passes. If the return code returns anything else, the transaction, and, more importantly, the iteration fails.

              I have now successfully built some spaghetti code that issues the error "Search failed" and says "Transaction "Check" ended with "Fail" status", but the Iteration shows as a success when I view the Test results...

              This has to be very simple, but what am I forgetting? (and, no, I do not have Continue on Error activated)

              Arghhh...

              Randy Stevenson
              Data & Application Services - Performance Testing Team
              Infrastructure Analyst
              Deere & Company
              1 John Deere Place
              WOB 2NW
              Moline, IL 61265
              (309) 765-0983
              Cell: (309) 737-6385
              StevensonRandy@ JohnDeere. com<mailto:Stevenso nRandy@ JohnDeere. com>

              "Why is there never enough time to do things right, but always enough time to do them over?"

              [Non-text portions of this message have been removed]

              Check out the all-new Messenger 9.0! Go to http://in.messenger .yahoo.com/

              [Non-text portions of this message have been removed]

              [Non-text portions of this message have been removed]

















              Add more friends to your messenger and enjoy! Go to http://messenger.yahoo.com/invite/

              [Non-text portions of this message have been removed]
            • Michael Foley
              I do not see where you are initializing  iSuccess.  you never explicity set it to 0.   -m ... From: Stevenson Randy
              Message 6 of 12 , Mar 2, 2009
              • 0 Attachment
                I do not see where you are initializing  iSuccess.  you never explicity set it to 0.
                 
                -m


                --- On Mon, 3/2/09, Stevenson Randy <StevensonRandalJ@...> wrote:

                From: Stevenson Randy <StevensonRandalJ@...>
                Subject: RE: [LoadRunner] Forcing an Iteration to Fail
                To: "'LoadRunner@yahoogroups.com'" <LoadRunner@yahoogroups.com>
                Date: Monday, March 2, 2009, 12:43 AM






                Perhaps I was not as clear as I could have been in my description of my problem. I have a web_submit_form action function in my script for which I am trying to verify success or failure. It is not possible to simply use a web_reg_find statement to check the return because there are two types of successful return codes sent back from the application: "getReturn code=0" or "getReturn code=4". So, here is what I have right now:

                int iRC_0, RC_4, iSuccess;

                web_reg_save_ param("RC_ Check_0",
                "LB=getReturnCode" ,
                "RB=0\n",
                "Ord=All",
                "NotFound=warning" ,
                LAST);

                web_reg_save_ param("RC_ Check_4",
                "LB=getReturnCode" ,
                "RB=4\n",
                "Ord=All",
                "NotFound=warning" ,
                LAST);

                web_submit_data( "CKCWSv12TestSer vlet",
                .....
                .....
                .....

                iRC_0=atoi(lr_ eval_string( "{RC_Check_ 0_count}" ));

                iRC_4=atoi(lr_ eval_string( "{RC_Check_ 4_count}" ));

                if (iRC_0 == 1) {
                lr_vuser_status_ message( "Here I am - 0");
                iSuccess=1;
                }

                if (iRC_4 == 1) {
                lr_vuser_status_ message( "Here I am - 4");
                iSuccess=1;
                }

                if (iSuccess==0) {

                lr_fail_trans_ with_error( "web_submit_ data failed");
                lr_end_transaction( "01_04_CKC_ ClickOn_Enter_ SearchWithLastNa me",LR_AUTO) ;
                return;

                }else{

                lr_end_transaction( "01_04_CKC_ ClickOn_Enter_ SearchWithLastNa me",LR_AUTO) ;

                }
                As I already conceded, spaghetti code...

                Anyway, if the function finds a return code of 0 or 4, it succeeds as it is supposed to. However, if it does not get a return code 0 or 4, I see this in the Playback Log:

                Action.c(114) : Error: Search failed
                Action.c(116) : Notify: Transaction "01_04_CKC_ClickOn_ Enter_SearchWith LastName" ended with "Fail" status (Duration: 0.3203 Wasted Time: 0.0000).
                Ending action Action.
                Ending iteration 3.

                But in the "View --> Test Results", all Transactions show as "Passed". So how can that be? And what do I have to do to make the Iteration fail. My Test Results should look like this for the first 10 iterations:

                Passed
                Passed
                Failed
                Passed
                Failed
                Passed
                Passed
                Passed
                Failed
                Failed

                Randy Stevenson
                Data & Application Services - Performance Testing Team
                Infrastructure Analyst
                Deere & Company
                1 John Deere Place
                WOB 2NW
                Moline, IL 61265
                (309) 765-0983
                Cell: (309) 737-6385
                StevensonRandy@ JohnDeere. com<mailto:StevensonRandy@ JohnDeere. com>

                "Why is there never enough time to do things right, but always enough time to do them over?"

                ____________ _________ _________ __
                From: LoadRunner@yahoogro ups.com [mailto:LoadRunner@yahoogro ups.com] On Behalf Of Kiran
                Sent: Sunday, March 01, 2009 12:59 PM
                To: LoadRunner@yahoogro ups.com
                Subject: Re: [LoadRunner] Forcing an Iteration to Fail

                I am not sure if there is any function in LR which has return code as 0 and 4,I have seen and used only 2 return codes values and those are 0 for pass and 1 for fail or it could be vice versa.
                well I am not sure what do you mean by iteration failure,if your code says that it has exit iteration based on failure condition,then it has to exit.Maybe you might seeing End action as pass in your test results.
                Any ways, here is suggestion you should do to debug your code,
                first make sure that your conditions are working correctly,do not exit the iteration even it fails.

                once you know that your code is working correctly,then add exit on failure clause with iteration.I dont remember the function but its one line function,just keep it beneath lr_fail transaction and once your condition is met,i.e transaction fails ,it will exit the iteration.

                It happens sometimes,you just need to have some more patience while you are dealing with code,frustation and getting panic are one of the worst behaviour that affects the creative mind.

                if still you cannot do it,assume that either transaction is passing or your logic is faulty and finally you can also paste the code here,I am assuming that you have condition where in iteration exits only for failure and not for success.

                --- On Sat, 28/2/09, Stevenson Randy <StevensonRandalJ@ JohnDeere. com<mailto:StevensonRa ndalJ%40JohnDeer e.com>> wrote:

                From: Stevenson Randy <StevensonRandalJ@ JohnDeere. com<mailto:StevensonRa ndalJ%40JohnDeer e.com>>
                Subject: [LoadRunner] Forcing an Iteration to Fail
                To: "'LoadRunner@ yahoogroups. com<mailto:%27LoadRunn er%40yahoogroups .com>'" <LoadRunner@yahoogro ups.com<mailto:LoadRunner% 40yahoogroups. com>>
                Date: Saturday, 28 February, 2009, 3:59 AM

                Do you ever have those moments when you have used LoadRunner for over 8 years and you cannot for your life remember how to do something simple? Well, I seem to be having one of those moments.

                I am trying to test for use case success by testing for the return code from one of my transactions. If the return code is 0 or 4, the transaction passes. If the return code returns anything else, the transaction, and, more importantly, the iteration fails.

                I have now successfully built some spaghetti code that issues the error "Search failed" and says "Transaction "Check" ended with "Fail" status", but the Iteration shows as a success when I view the Test results...

                This has to be very simple, but what am I forgetting? (and, no, I do not have Continue on Error activated)

                Arghhh...

                Randy Stevenson
                Data & Application Services - Performance Testing Team
                Infrastructure Analyst
                Deere & Company
                1 John Deere Place
                WOB 2NW
                Moline, IL 61265
                (309) 765-0983
                Cell: (309) 737-6385
                StevensonRandy@ JohnDeere. com<mailto:Stevenso nRandy@ JohnDeere. com>

                "Why is there never enough time to do things right, but always enough time to do them over?"

                [Non-text portions of this message have been removed]

                Check out the all-new Messenger 9.0! Go to http://in.messenger .yahoo.com/

                [Non-text portions of this message have been removed]

                [Non-text portions of this message have been removed]



















                [Non-text portions of this message have been removed]
              • Seger, Dave
                If you set the return code to a -1 you will get a failure in the test results. Dave ________________________________ From: LoadRunner@yahoogroups.com
                Message 7 of 12 , Mar 2, 2009
                • 0 Attachment
                  If you set the return code to a -1 you will get a failure in the test results.

                  Dave


                  ________________________________
                  From: LoadRunner@yahoogroups.com [mailto:LoadRunner@yahoogroups.com] On Behalf Of Kiran
                  Sent: Monday, March 02, 2009 10:12 AM
                  To: LoadRunner@yahoogroups.com
                  Subject: RE: [LoadRunner] Forcing an Iteration to Fail


                  Assuming that "getReturn code=0" or "getReturn code=4". remains static for entire duration of tests,
                  you can also WRSP Return code in place of WRF.
                  INT WRF1,INT WRF2,int z ;
                  WRF1= WEB_REG_FIND( YOUR RC_CHECK_01);
                  WRF1= WEB_REG_FIND(YOUR RC_CHECK_04);
                  z= web_submit_data( "CKCWSv12TestSer vlet",);
                  IF (WRF1==0&&WRF2==1)//wrf1 passess and WRF2 Fails
                  lr_vuser_status_ message( "I AM AT RC_CHECK_01");
                  ELSE
                  lr_vuser_status_ message( "I AM AT RC_CHECK_04");
                  if (Z==1);
                  lr_exit_tranasction ();

                  --- On Mon, 2/3/09, Stevenson Randy <StevensonRandalJ@...<mailto:StevensonRandalJ%40JohnDeere.com>> wrote:

                  From: Stevenson Randy <StevensonRandalJ@...<mailto:StevensonRandalJ%40JohnDeere.com>>
                  Subject: RE: [LoadRunner] Forcing an Iteration to Fail
                  To: "'LoadRunner@yahoogroups.com<mailto:%27LoadRunner%40yahoogroups.com>'" <LoadRunner@yahoogroups.com<mailto:LoadRunner%40yahoogroups.com>>
                  Date: Monday, 2 March, 2009, 11:13 AM

                  Perhaps I was not as clear as I could have been in my description of my problem. I have a web_submit_form action function in my script for which I am trying to verify success or failure. It is not possible to simply use a web_reg_find statement to check the return because there are two types of successful return codes sent back from the application: "getReturn code=0" or "getReturn code=4". So, here is what I have right now:

                  int iRC_0, RC_4, iSuccess;

                  web_reg_save_ param("RC_ Check_0",
                  "LB=getReturnCode" ,
                  "RB=0\n",
                  "Ord=All",
                  "NotFound=warning" ,
                  LAST);

                  web_reg_save_ param("RC_ Check_4",
                  "LB=getReturnCode" ,
                  "RB=4\n",
                  "Ord=All",
                  "NotFound=warning" ,
                  LAST);

                  web_submit_data( "CKCWSv12TestSer vlet",
                  ......
                  ......
                  ......

                  iRC_0=atoi(lr_ eval_string( "{RC_Check_ 0_count}" ));

                  iRC_4=atoi(lr_ eval_string( "{RC_Check_ 4_count}" ));

                  if (iRC_0 == 1) {
                  lr_vuser_status_ message( "Here I am - 0");
                  iSuccess=1;
                  }

                  if (iRC_4 == 1) {
                  lr_vuser_status_ message( "Here I am - 4");
                  iSuccess=1;
                  }

                  if (iSuccess==0) {

                  lr_fail_trans_ with_error( "web_submit_ data failed");
                  lr_end_transaction( "01_04_CKC_ ClickOn_Enter_ SearchWithLastNa me",LR_AUTO) ;
                  return;

                  }else{

                  lr_end_transaction( "01_04_CKC_ ClickOn_Enter_ SearchWithLastNa me",LR_AUTO) ;

                  }
                  As I already conceded, spaghetti code...

                  Anyway, if the function finds a return code of 0 or 4, it succeeds as it is supposed to. However, if it does not get a return code 0 or 4, I see this in the Playback Log:

                  Action.c(114) : Error: Search failed
                  Action.c(116) : Notify: Transaction "01_04_CKC_ClickOn_ Enter_SearchWith LastName" ended with "Fail" status (Duration: 0.3203 Wasted Time: 0.0000).
                  Ending action Action.
                  Ending iteration 3.

                  But in the "View --> Test Results", all Transactions show as "Passed". So how can that be? And what do I have to do to make the Iteration fail. My Test Results should look like this for the first 10 iterations:

                  Passed
                  Passed
                  Failed
                  Passed
                  Failed
                  Passed
                  Passed
                  Passed
                  Failed
                  Failed

                  Randy Stevenson
                  Data & Application Services - Performance Testing Team
                  Infrastructure Analyst
                  Deere & Company
                  1 John Deere Place
                  WOB 2NW
                  Moline, IL 61265
                  (309) 765-0983
                  Cell: (309) 737-6385
                  StevensonRandy@ JohnDeere. com<mailto:StevensonRandy@ JohnDeere. com>

                  "Why is there never enough time to do things right, but always enough time to do them over?"

                  ____________ _________ _________ __
                  From: LoadRunner@yahoogro ups.com [mailto:LoadRunner@yahoogro ups.com] On Behalf Of Kiran
                  Sent: Sunday, March 01, 2009 12:59 PM
                  To: LoadRunner@yahoogro ups.com
                  Subject: Re: [LoadRunner] Forcing an Iteration to Fail

                  I am not sure if there is any function in LR which has return code as 0 and 4,I have seen and used only 2 return codes values and those are 0 for pass and 1 for fail or it could be vice versa.
                  well I am not sure what do you mean by iteration failure,if your code says that it has exit iteration based on failure condition,then it has to exit.Maybe you might seeing End action as pass in your test results.
                  Any ways, here is suggestion you should do to debug your code,
                  first make sure that your conditions are working correctly,do not exit the iteration even it fails.

                  once you know that your code is working correctly,then add exit on failure clause with iteration.I dont remember the function but its one line function,just keep it beneath lr_fail transaction and once your condition is met,i..e transaction fails ,it will exit the iteration.

                  It happens sometimes,you just need to have some more patience while you are dealing with code,frustation and getting panic are one of the worst behaviour that affects the creative mind.

                  if still you cannot do it,assume that either transaction is passing or your logic is faulty and finally you can also paste the code here,I am assuming that you have condition where in iteration exits only for failure and not for success.

                  --- On Sat, 28/2/09, Stevenson Randy <StevensonRandalJ@ JohnDeere. com<mailto:StevensonRa ndalJ%40JohnDeer e.com>> wrote:

                  From: Stevenson Randy <StevensonRandalJ@ JohnDeere. com<mailto:StevensonRa ndalJ%40JohnDeer e.com>>
                  Subject: [LoadRunner] Forcing an Iteration to Fail
                  To: "'LoadRunner@ yahoogroups. com<mailto:%27LoadRunn er%40yahoogroups .com>'" <LoadRunner@yahoogro ups.com<mailto:LoadRunner% 40yahoogroups. com>>
                  Date: Saturday, 28 February, 2009, 3:59 AM

                  Do you ever have those moments when you have used LoadRunner for over 8 years and you cannot for your life remember how to do something simple? Well, I seem to be having one of those moments.

                  I am trying to test for use case success by testing for the return code from one of my transactions. If the return code is 0 or 4, the transaction passes. If the return code returns anything else, the transaction, and, more importantly, the iteration fails.

                  I have now successfully built some spaghetti code that issues the error "Search failed" and says "Transaction "Check" ended with "Fail" status", but the Iteration shows as a success when I view the Test results...

                  This has to be very simple, but what am I forgetting? (and, no, I do not have Continue on Error activated)

                  Arghhh...

                  Randy Stevenson
                  Data & Application Services - Performance Testing Team
                  Infrastructure Analyst
                  Deere & Company
                  1 John Deere Place
                  WOB 2NW
                  Moline, IL 61265
                  (309) 765-0983
                  Cell: (309) 737-6385
                  StevensonRandy@ JohnDeere. com<mailto:Stevenso nRandy@ JohnDeere. com>

                  "Why is there never enough time to do things right, but always enough time to do them over?"

                  [Non-text portions of this message have been removed]

                  Check out the all-new Messenger 9.0! Go to http://in.messenger .yahoo.com/

                  [Non-text portions of this message have been removed]

                  [Non-text portions of this message have been removed]

                  Add more friends to your messenger and enjoy! Go to http://messenger.yahoo.com/invite/

                  [Non-text portions of this message have been removed]




                  -----------------------------------------
                  This message and any attachments are intended only for the use of
                  the addressee and may contain information that is privileged and
                  confidential. If the reader of the message is not the intended
                  recipient or an authorized representative of the intended
                  recipient, you are hereby notified that any dissemination of this
                  communication is strictly prohibited. If you have received this
                  communication in error, notify the sender immediately by return
                  email and delete the message and any attachments from your system.

                  [Non-text portions of this message have been removed]
                • James Pulley
                  But you will also have no more iterations return (-1); generally means catastrophic failure, end this iteration and iterate no more ... From:
                  Message 8 of 12 , Mar 2, 2009
                  • 0 Attachment
                    But you will also have no more iterations

                    "return (-1);" generally means catastrophic failure, "end this iteration and
                    iterate no more"

                    -----Original Message-----
                    From: LoadRunner@yahoogroups.com [mailto:LoadRunner@yahoogroups.com] On
                    Behalf Of Seger, Dave
                    Sent: Monday, March 02, 2009 11:07 AM
                    To: LoadRunner@yahoogroups.com
                    Subject: RE: [LoadRunner] Forcing an Iteration to Fail

                    If you set the return code to a -1 you will get a failure in the test
                    results.

                    Dave


                    ________________________________
                    From: LoadRunner@yahoogroups.com [mailto:LoadRunner@yahoogroups.com] On
                    Behalf Of Kiran
                    Sent: Monday, March 02, 2009 10:12 AM
                    To: LoadRunner@yahoogroups.com
                    Subject: RE: [LoadRunner] Forcing an Iteration to Fail


                    Assuming that "getReturn code=0" or "getReturn code=4". remains static for
                    entire duration of tests, you can also WRSP Return code in place of WRF.
                    INT WRF1,INT WRF2,int z ;
                    WRF1= WEB_REG_FIND( YOUR RC_CHECK_01);
                    WRF1= WEB_REG_FIND(YOUR RC_CHECK_04);
                    z= web_submit_data( "CKCWSv12TestSer vlet",); IF (WRF1==0&&WRF2==1)//wrf1
                    passess and WRF2 Fails lr_vuser_status_ message( "I AM AT RC_CHECK_01");
                    ELSE lr_vuser_status_ message( "I AM AT RC_CHECK_04"); if (Z==1);
                    lr_exit_tranasction ();

                    --- On Mon, 2/3/09, Stevenson Randy
                    <StevensonRandalJ@...<mailto:StevensonRandalJ%40JohnDeere.com>>
                    wrote:

                    From: Stevenson Randy
                    <StevensonRandalJ@...<mailto:StevensonRandalJ%40JohnDeere.com>>
                    Subject: RE: [LoadRunner] Forcing an Iteration to Fail
                    To: "'LoadRunner@yahoogroups.com<mailto:%27LoadRunner%40yahoogroups.com>'"
                    <LoadRunner@yahoogroups.com<mailto:LoadRunner%40yahoogroups.com>>
                    Date: Monday, 2 March, 2009, 11:13 AM

                    Perhaps I was not as clear as I could have been in my description of my
                    problem. I have a web_submit_form action function in my script for which I
                    am trying to verify success or failure. It is not possible to simply use a
                    web_reg_find statement to check the return because there are two types of
                    successful return codes sent back from the application: "getReturn code=0"
                    or "getReturn code=4". So, here is what I have right now:

                    int iRC_0, RC_4, iSuccess;

                    web_reg_save_ param("RC_ Check_0",
                    "LB=getReturnCode" ,
                    "RB=0\n",
                    "Ord=All",
                    "NotFound=warning" ,
                    LAST);

                    web_reg_save_ param("RC_ Check_4",
                    "LB=getReturnCode" ,
                    "RB=4\n",
                    "Ord=All",
                    "NotFound=warning" ,
                    LAST);

                    web_submit_data( "CKCWSv12TestSer vlet", ......
                    ......
                    ......

                    iRC_0=atoi(lr_ eval_string( "{RC_Check_ 0_count}" ));

                    iRC_4=atoi(lr_ eval_string( "{RC_Check_ 4_count}" ));

                    if (iRC_0 == 1) {
                    lr_vuser_status_ message( "Here I am - 0"); iSuccess=1; }

                    if (iRC_4 == 1) {
                    lr_vuser_status_ message( "Here I am - 4"); iSuccess=1; }

                    if (iSuccess==0) {

                    lr_fail_trans_ with_error( "web_submit_ data failed"); lr_end_transaction(
                    "01_04_CKC_ ClickOn_Enter_ SearchWithLastNa me",LR_AUTO) ; return;

                    }else{

                    lr_end_transaction( "01_04_CKC_ ClickOn_Enter_ SearchWithLastNa me",LR_AUTO)
                    ;

                    }
                    As I already conceded, spaghetti code...

                    Anyway, if the function finds a return code of 0 or 4, it succeeds as it is
                    supposed to. However, if it does not get a return code 0 or 4, I see this in
                    the Playback Log:

                    Action.c(114) : Error: Search failed
                    Action.c(116) : Notify: Transaction "01_04_CKC_ClickOn_ Enter_SearchWith
                    LastName" ended with "Fail" status (Duration: 0.3203 Wasted Time: 0.0000).
                    Ending action Action.
                    Ending iteration 3.

                    But in the "View --> Test Results", all Transactions show as "Passed". So
                    how can that be? And what do I have to do to make the Iteration fail. My
                    Test Results should look like this for the first 10 iterations:

                    Passed
                    Passed
                    Failed
                    Passed
                    Failed
                    Passed
                    Passed
                    Passed
                    Failed
                    Failed

                    Randy Stevenson
                    Data & Application Services - Performance Testing Team Infrastructure
                    Analyst Deere & Company
                    1 John Deere Place
                    WOB 2NW
                    Moline, IL 61265
                    (309) 765-0983
                    Cell: (309) 737-6385
                    StevensonRandy@ JohnDeere. com<mailto:StevensonRandy@ JohnDeere. com>

                    "Why is there never enough time to do things right, but always enough time
                    to do them over?"

                    ____________ _________ _________ __
                    From: LoadRunner@yahoogro ups.com [mailto:LoadRunner@yahoogro ups.com] On
                    Behalf Of Kiran
                    Sent: Sunday, March 01, 2009 12:59 PM
                    To: LoadRunner@yahoogro ups.com
                    Subject: Re: [LoadRunner] Forcing an Iteration to Fail

                    I am not sure if there is any function in LR which has return code as 0 and
                    4,I have seen and used only 2 return codes values and those are 0 for pass
                    and 1 for fail or it could be vice versa.
                    well I am not sure what do you mean by iteration failure,if your code says
                    that it has exit iteration based on failure condition,then it has to
                    exit.Maybe you might seeing End action as pass in your test results.
                    Any ways, here is suggestion you should do to debug your code, first make
                    sure that your conditions are working correctly,do not exit the iteration
                    even it fails.

                    once you know that your code is working correctly,then add exit on failure
                    clause with iteration.I dont remember the function but its one line
                    function,just keep it beneath lr_fail transaction and once your condition is
                    met,i..e transaction fails ,it will exit the iteration.

                    It happens sometimes,you just need to have some more patience while you are
                    dealing with code,frustation and getting panic are one of the worst
                    behaviour that affects the creative mind.

                    if still you cannot do it,assume that either transaction is passing or your
                    logic is faulty and finally you can also paste the code here,I am assuming
                    that you have condition where in iteration exits only for failure and not
                    for success.

                    --- On Sat, 28/2/09, Stevenson Randy <StevensonRandalJ@ JohnDeere.
                    com<mailto:StevensonRa ndalJ%40JohnDeer e.com>> wrote:

                    From: Stevenson Randy <StevensonRandalJ@ JohnDeere. com<mailto:StevensonRa
                    ndalJ%40JohnDeer e.com>>
                    Subject: [LoadRunner] Forcing an Iteration to Fail
                    To: "'LoadRunner@ yahoogroups. com<mailto:%27LoadRunn er%40yahoogroups
                    .com>'" <LoadRunner@yahoogro ups.com<mailto:LoadRunner% 40yahoogroups. com>>
                    Date: Saturday, 28 February, 2009, 3:59 AM

                    Do you ever have those moments when you have used LoadRunner for over 8
                    years and you cannot for your life remember how to do something simple?
                    Well, I seem to be having one of those moments.

                    I am trying to test for use case success by testing for the return code from
                    one of my transactions. If the return code is 0 or 4, the transaction
                    passes. If the return code returns anything else, the transaction, and, more
                    importantly, the iteration fails.

                    I have now successfully built some spaghetti code that issues the error
                    "Search failed" and says "Transaction "Check" ended with "Fail" status", but
                    the Iteration shows as a success when I view the Test results...

                    This has to be very simple, but what am I forgetting? (and, no, I do not
                    have Continue on Error activated)

                    Arghhh...

                    Randy Stevenson
                    Data & Application Services - Performance Testing Team Infrastructure
                    Analyst Deere & Company
                    1 John Deere Place
                    WOB 2NW
                    Moline, IL 61265
                    (309) 765-0983
                    Cell: (309) 737-6385
                    StevensonRandy@ JohnDeere. com<mailto:Stevenso nRandy@ JohnDeere. com>

                    "Why is there never enough time to do things right, but always enough time
                    to do them over?"

                    [Non-text portions of this message have been removed]

                    Check out the all-new Messenger 9.0! Go to http://in.messenger .yahoo.com/

                    [Non-text portions of this message have been removed]

                    [Non-text portions of this message have been removed]

                    Add more friends to your messenger and enjoy! Go to
                    http://messenger.yahoo.com/invite/

                    [Non-text portions of this message have been removed]




                    -----------------------------------------
                    This message and any attachments are intended only for the use of the
                    addressee and may contain information that is privileged and confidential.
                    If the reader of the message is not the intended recipient or an authorized
                    representative of the intended recipient, you are hereby notified that any
                    dissemination of this communication is strictly prohibited. If you have
                    received this communication in error, notify the sender immediately by
                    return email and delete the message and any attachments from your system.

                    [Non-text portions of this message have been removed]



                    ------------------------------------

                    Yahoo! Groups Links
                  • corey bailey
                    Perhaps we look at if from the other direction, how many fail return codes are there? you could create content checks and list every fail rule;
                    Message 9 of 12 , Mar 2, 2009
                    • 0 Attachment
                      Perhaps we look at if from the other direction, how many fail return codes
                      are there?
                      you could create content checks and list every fail
                      rule; getReturnCode=1, getReturnCode=2, getReturnCode=3, getReturnCode=5 etc...

                      no more spaghetti code.

                      On Mon, Mar 2, 2009 at 12:43 AM, Stevenson Randy <
                      StevensonRandalJ@...> wrote:

                      > Perhaps I was not as clear as I could have been in my description of my
                      > problem. I have a web_submit_form action function in my script for which I
                      > am trying to verify success or failure. It is not possible to simply use a
                      > web_reg_find statement to check the return because there are two types of
                      > successful return codes sent back from the application: "getReturn code=0"
                      > or "getReturn code=4". So, here is what I have right now:
                      >
                      > int iRC_0, RC_4, iSuccess;
                      >
                      > web_reg_save_param("RC_Check_0",
                      > "LB=getReturnCode",
                      > "RB=0\n",
                      > "Ord=All",
                      > "NotFound=warning",
                      > LAST);
                      >
                      > web_reg_save_param("RC_Check_4",
                      > "LB=getReturnCode",
                      > "RB=4\n",
                      > "Ord=All",
                      > "NotFound=warning",
                      > LAST);
                      >
                      > web_submit_data("CKCWSv12TestServlet",
                      > .....
                      > .....
                      > .....
                      >
                      > iRC_0=atoi(lr_eval_string("{RC_Check_0_count}"));
                      >
                      > iRC_4=atoi(lr_eval_string("{RC_Check_4_count}"));
                      >
                      > if (iRC_0 == 1) {
                      > lr_vuser_status_message( "Here I am - 0");
                      > iSuccess=1;
                      > }
                      >
                      > if (iRC_4 == 1) {
                      > lr_vuser_status_message( "Here I am - 4");
                      > iSuccess=1;
                      > }
                      >
                      > if (iSuccess==0) {
                      >
                      > lr_fail_trans_with_error("web_submit_data failed");
                      > lr_end_transaction("01_04_CKC_ClickOn_Enter_SearchWithLastName",LR_AUTO);
                      > return;
                      >
                      > }else{
                      >
                      > lr_end_transaction("01_04_CKC_ClickOn_Enter_SearchWithLastName",LR_AUTO);
                      >
                      > }
                      > As I already conceded, spaghetti code...
                      >
                      > Anyway, if the function finds a return code of 0 or 4, it succeeds as it is
                      > supposed to. However, if it does not get a return code 0 or 4, I see this in
                      > the Playback Log:
                      >
                      > Action.c(114): Error: Search failed
                      > Action.c(116): Notify: Transaction
                      > "01_04_CKC_ClickOn_Enter_SearchWithLastName" ended with "Fail" status
                      > (Duration: 0.3203 Wasted Time: 0.0000).
                      > Ending action Action.
                      > Ending iteration 3.
                      >
                      > But in the "View --> Test Results", all Transactions show as "Passed". So
                      > how can that be? And what do I have to do to make the Iteration fail. My
                      > Test Results should look like this for the first 10 iterations:
                      >
                      > Passed
                      > Passed
                      > Failed
                      > Passed
                      > Failed
                      > Passed
                      > Passed
                      > Passed
                      > Failed
                      > Failed
                      >
                      >
                      > Randy Stevenson
                      > Data & Application Services - Performance Testing Team
                      > Infrastructure Analyst
                      > Deere & Company
                      > 1 John Deere Place
                      > WOB 2NW
                      > Moline, IL 61265
                      > (309) 765-0983
                      > Cell: (309) 737-6385
                      > StevensonRandy@... <StevensonRandy%40JohnDeere.com><mailto:
                      > StevensonRandy@... <StevensonRandy%40JohnDeere.com>>
                      >
                      > "Why is there never enough time to do things right, but always enough time
                      > to do them over?"
                      >
                      > ________________________________
                      > From: LoadRunner@yahoogroups.com <LoadRunner%40yahoogroups.com> [mailto:
                      > LoadRunner@yahoogroups.com <LoadRunner%40yahoogroups.com>] On Behalf Of
                      > Kiran
                      > Sent: Sunday, March 01, 2009 12:59 PM
                      > To: LoadRunner@yahoogroups.com <LoadRunner%40yahoogroups.com>
                      > Subject: Re: [LoadRunner] Forcing an Iteration to Fail
                      >
                      > I am not sure if there is any function in LR which has return code as 0 and
                      > 4,I have seen and used only 2 return codes values and those are 0 for pass
                      > and 1 for fail or it could be vice versa.
                      > well I am not sure what do you mean by iteration failure,if your code says
                      > that it has exit iteration based on failure condition,then it has to
                      > exit.Maybe you might seeing End action as pass in your test results.
                      > Any ways, here is suggestion you should do to debug your code,
                      > first make sure that your conditions are working correctly,do not exit the
                      > iteration even it fails.
                      >
                      > once you know that your code is working correctly,then add exit on failure
                      > clause with iteration.I dont remember the function but its one line
                      > function,just keep it beneath lr_fail transaction and once your condition is
                      > met,i.e transaction fails ,it will exit the iteration.
                      >
                      > It happens sometimes,you just need to have some more patience while you are
                      > dealing with code,frustation and getting panic are one of the worst
                      > behaviour that affects the creative mind.
                      >
                      > if still you cannot do it,assume that either transaction is passing or your
                      > logic is faulty and finally you can also paste the code here,I am assuming
                      > that you have condition where in iteration exits only for failure and not
                      > for success.
                      >
                      > --- On Sat, 28/2/09, Stevenson Randy <StevensonRandalJ@...<StevensonRandalJ%40JohnDeere.com>
                      > <mailto:StevensonRandalJ%40JohnDeere.com<StevensonRandalJ%2540JohnDeere.com>>>
                      > wrote:
                      >
                      > From: Stevenson Randy <StevensonRandalJ@...<StevensonRandalJ%40JohnDeere.com>
                      > <mailto:StevensonRandalJ%40JohnDeere.com<StevensonRandalJ%2540JohnDeere.com>
                      > >>
                      > Subject: [LoadRunner] Forcing an Iteration to Fail
                      > To: "'LoadRunner@yahoogroups.com <%27LoadRunner%40yahoogroups.com><mailto:
                      > %27LoadRunner%40yahoogroups.com>'" <LoadRunner@yahoogroups.com<LoadRunner%40yahoogroups.com>
                      > <mailto:LoadRunner%40yahoogroups.com <LoadRunner%2540yahoogroups.com>>>
                      > Date: Saturday, 28 February, 2009, 3:59 AM
                      >
                      > Do you ever have those moments when you have used LoadRunner for over 8
                      > years and you cannot for your life remember how to do something simple?
                      > Well, I seem to be having one of those moments.
                      >
                      > I am trying to test for use case success by testing for the return code
                      > from one of my transactions. If the return code is 0 or 4, the transaction
                      > passes. If the return code returns anything else, the transaction, and, more
                      > importantly, the iteration fails.
                      >
                      > I have now successfully built some spaghetti code that issues the error
                      > "Search failed" and says "Transaction "Check" ended with "Fail" status", but
                      > the Iteration shows as a success when I view the Test results...
                      >
                      > This has to be very simple, but what am I forgetting? (and, no, I do not
                      > have Continue on Error activated)
                      >
                      > Arghhh...
                      >
                      > Randy Stevenson
                      > Data & Application Services - Performance Testing Team
                      > Infrastructure Analyst
                      > Deere & Company
                      > 1 John Deere Place
                      > WOB 2NW
                      > Moline, IL 61265
                      > (309) 765-0983
                      > Cell: (309) 737-6385
                      > StevensonRandy@ JohnDeere. com<mailto:StevensonRandy@ JohnDeere. com>
                      >
                      > "Why is there never enough time to do things right, but always enough time
                      > to do them over?"
                      >
                      > [Non-text portions of this message have been removed]
                      >
                      > Check out the all-new Messenger 9.0! Go to http://in.messenger.yahoo.com/
                      >
                      > [Non-text portions of this message have been removed]
                      >
                      > [Non-text portions of this message have been removed]
                      >
                      >
                      >



                      --
                      Corey Bailey
                      Principal Consultant
                      Citizencrane Consulting


                      [Non-text portions of this message have been removed]
                    • Seger, Dave
                      Controlling the run with appropriate continue on error statements will allow continuation. Dave ________________________________ From:
                      Message 10 of 12 , Mar 2, 2009
                      • 0 Attachment
                        Controlling the run with appropriate "continue on error" statements will allow continuation.

                        Dave

                        ________________________________
                        From: LoadRunner@yahoogroups.com [mailto:LoadRunner@yahoogroups.com] On Behalf Of James Pulley
                        Sent: Monday, March 02, 2009 11:17 AM
                        To: LoadRunner@yahoogroups.com
                        Subject: RE: [LoadRunner] Forcing an Iteration to Fail


                        But you will also have no more iterations

                        "return (-1);" generally means catastrophic failure, "end this iteration and
                        iterate no more"

                        -----Original Message-----
                        From: LoadRunner@yahoogroups.com<mailto:LoadRunner%40yahoogroups.com> [mailto:LoadRunner@yahoogroups.com<mailto:LoadRunner%40yahoogroups.com>] On
                        Behalf Of Seger, Dave
                        Sent: Monday, March 02, 2009 11:07 AM
                        To: LoadRunner@yahoogroups.com<mailto:LoadRunner%40yahoogroups.com>
                        Subject: RE: [LoadRunner] Forcing an Iteration to Fail

                        If you set the return code to a -1 you will get a failure in the test
                        results.

                        Dave

                        ________________________________
                        From: LoadRunner@yahoogroups.com<mailto:LoadRunner%40yahoogroups.com> [mailto:LoadRunner@yahoogroups.com<mailto:LoadRunner%40yahoogroups.com>] On
                        Behalf Of Kiran
                        Sent: Monday, March 02, 2009 10:12 AM
                        To: LoadRunner@yahoogroups.com<mailto:LoadRunner%40yahoogroups.com>
                        Subject: RE: [LoadRunner] Forcing an Iteration to Fail

                        Assuming that "getReturn code=0" or "getReturn code=4". remains static for
                        entire duration of tests, you can also WRSP Return code in place of WRF.
                        INT WRF1,INT WRF2,int z ;
                        WRF1= WEB_REG_FIND( YOUR RC_CHECK_01);
                        WRF1= WEB_REG_FIND(YOUR RC_CHECK_04);
                        z= web_submit_data( "CKCWSv12TestSer vlet",); IF (WRF1==0&&WRF2==1)//wrf1
                        passess and WRF2 Fails lr_vuser_status_ message( "I AM AT RC_CHECK_01");
                        ELSE lr_vuser_status_ message( "I AM AT RC_CHECK_04"); if (Z==1);
                        lr_exit_tranasction ();

                        --- On Mon, 2/3/09, Stevenson Randy
                        <StevensonRandalJ@...<mailto:StevensonRandalJ%40JohnDeere.com><mailto:StevensonRandalJ%40JohnDeere.com>>
                        wrote:

                        From: Stevenson Randy
                        <StevensonRandalJ@...<mailto:StevensonRandalJ%40JohnDeere.com><mailto:StevensonRandalJ%40JohnDeere.com>>
                        Subject: RE: [LoadRunner] Forcing an Iteration to Fail
                        To: "'LoadRunner@yahoogroups.com<mailto:%27LoadRunner%40yahoogroups.com><mailto:%27LoadRunner%40yahoogroups.com>'"
                        <LoadRunner@yahoogroups.com<mailto:LoadRunner%40yahoogroups.com><mailto:LoadRunner%40yahoogroups.com>>
                        Date: Monday, 2 March, 2009, 11:13 AM

                        Perhaps I was not as clear as I could have been in my description of my
                        problem. I have a web_submit_form action function in my script for which I
                        am trying to verify success or failure. It is not possible to simply use a
                        web_reg_find statement to check the return because there are two types of
                        successful return codes sent back from the application: "getReturn code=0"
                        or "getReturn code=4". So, here is what I have right now:

                        int iRC_0, RC_4, iSuccess;

                        web_reg_save_ param("RC_ Check_0",
                        "LB=getReturnCode" ,
                        "RB=0\n",
                        "Ord=All",
                        "NotFound=warning" ,
                        LAST);

                        web_reg_save_ param("RC_ Check_4",
                        "LB=getReturnCode" ,
                        "RB=4\n",
                        "Ord=All",
                        "NotFound=warning" ,
                        LAST);

                        web_submit_data( "CKCWSv12TestSer vlet", ......
                        .......
                        .......

                        iRC_0=atoi(lr_ eval_string( "{RC_Check_ 0_count}" ));

                        iRC_4=atoi(lr_ eval_string( "{RC_Check_ 4_count}" ));

                        if (iRC_0 == 1) {
                        lr_vuser_status_ message( "Here I am - 0"); iSuccess=1; }

                        if (iRC_4 == 1) {
                        lr_vuser_status_ message( "Here I am - 4"); iSuccess=1; }

                        if (iSuccess==0) {

                        lr_fail_trans_ with_error( "web_submit_ data failed"); lr_end_transaction(
                        "01_04_CKC_ ClickOn_Enter_ SearchWithLastNa me",LR_AUTO) ; return;

                        }else{

                        lr_end_transaction( "01_04_CKC_ ClickOn_Enter_ SearchWithLastNa me",LR_AUTO)
                        ;

                        }
                        As I already conceded, spaghetti code...

                        Anyway, if the function finds a return code of 0 or 4, it succeeds as it is
                        supposed to. However, if it does not get a return code 0 or 4, I see this in
                        the Playback Log:

                        Action.c(114) : Error: Search failed
                        Action.c(116) : Notify: Transaction "01_04_CKC_ClickOn_ Enter_SearchWith
                        LastName" ended with "Fail" status (Duration: 0.3203 Wasted Time: 0.0000).
                        Ending action Action.
                        Ending iteration 3.

                        But in the "View --> Test Results", all Transactions show as "Passed". So
                        how can that be? And what do I have to do to make the Iteration fail. My
                        Test Results should look like this for the first 10 iterations:

                        Passed
                        Passed
                        Failed
                        Passed
                        Failed
                        Passed
                        Passed
                        Passed
                        Failed
                        Failed

                        Randy Stevenson
                        Data & Application Services - Performance Testing Team Infrastructure
                        Analyst Deere & Company
                        1 John Deere Place
                        WOB 2NW
                        Moline, IL 61265
                        (309) 765-0983
                        Cell: (309) 737-6385
                        StevensonRandy@ JohnDeere. com<mailto:StevensonRandy@ JohnDeere. com>

                        "Why is there never enough time to do things right, but always enough time
                        to do them over?"

                        ____________ _________ _________ __
                        From: LoadRunner@yahoogro ups.com [mailto:LoadRunner@yahoogro ups.com] On
                        Behalf Of Kiran
                        Sent: Sunday, March 01, 2009 12:59 PM
                        To: LoadRunner@yahoogro ups.com
                        Subject: Re: [LoadRunner] Forcing an Iteration to Fail

                        I am not sure if there is any function in LR which has return code as 0 and
                        4,I have seen and used only 2 return codes values and those are 0 for pass
                        and 1 for fail or it could be vice versa.
                        well I am not sure what do you mean by iteration failure,if your code says
                        that it has exit iteration based on failure condition,then it has to
                        exit.Maybe you might seeing End action as pass in your test results.
                        Any ways, here is suggestion you should do to debug your code, first make
                        sure that your conditions are working correctly,do not exit the iteration
                        even it fails.

                        once you know that your code is working correctly,then add exit on failure
                        clause with iteration.I dont remember the function but its one line
                        function,just keep it beneath lr_fail transaction and once your condition is
                        met,i..e transaction fails ,it will exit the iteration.

                        It happens sometimes,you just need to have some more patience while you are
                        dealing with code,frustation and getting panic are one of the worst
                        behaviour that affects the creative mind.

                        if still you cannot do it,assume that either transaction is passing or your
                        logic is faulty and finally you can also paste the code here,I am assuming
                        that you have condition where in iteration exits only for failure and not
                        for success.

                        --- On Sat, 28/2/09, Stevenson Randy <StevensonRandalJ@ JohnDeere.
                        com<mailto:StevensonRa ndalJ%40JohnDeer e.com>> wrote:

                        From: Stevenson Randy <StevensonRandalJ@ JohnDeere. com<mailto:StevensonRa
                        ndalJ%40JohnDeer e.com>>
                        Subject: [LoadRunner] Forcing an Iteration to Fail
                        To: "'LoadRunner@ yahoogroups. com<mailto:%27LoadRunn er%40yahoogroups
                        ..com>'" <LoadRunner@yahoogro ups.com<mailto:LoadRunner% 40yahoogroups. com>>
                        Date: Saturday, 28 February, 2009, 3:59 AM

                        Do you ever have those moments when you have used LoadRunner for over 8
                        years and you cannot for your life remember how to do something simple?
                        Well, I seem to be having one of those moments.

                        I am trying to test for use case success by testing for the return code from
                        one of my transactions. If the return code is 0 or 4, the transaction
                        passes. If the return code returns anything else, the transaction, and, more
                        importantly, the iteration fails.

                        I have now successfully built some spaghetti code that issues the error
                        "Search failed" and says "Transaction "Check" ended with "Fail" status", but
                        the Iteration shows as a success when I view the Test results...

                        This has to be very simple, but what am I forgetting? (and, no, I do not
                        have Continue on Error activated)

                        Arghhh...

                        Randy Stevenson
                        Data & Application Services - Performance Testing Team Infrastructure
                        Analyst Deere & Company
                        1 John Deere Place
                        WOB 2NW
                        Moline, IL 61265
                        (309) 765-0983
                        Cell: (309) 737-6385
                        StevensonRandy@ JohnDeere. com<mailto:Stevenso nRandy@ JohnDeere. com>

                        "Why is there never enough time to do things right, but always enough time
                        to do them over?"

                        [Non-text portions of this message have been removed]

                        Check out the all-new Messenger 9.0! Go to http://in.messenger .yahoo.com/

                        [Non-text portions of this message have been removed]

                        [Non-text portions of this message have been removed]

                        Add more friends to your messenger and enjoy! Go to
                        http://messenger.yahoo.com/invite/

                        [Non-text portions of this message have been removed]

                        -----------------------------------------
                        This message and any attachments are intended only for the use of the
                        addressee and may contain information that is privileged and confidential.
                        If the reader of the message is not the intended recipient or an authorized
                        representative of the intended recipient, you are hereby notified that any
                        dissemination of this communication is strictly prohibited. If you have
                        received this communication in error, notify the sender immediately by
                        return email and delete the message and any attachments from your system.

                        [Non-text portions of this message have been removed]

                        ------------------------------------

                        Yahoo! Groups Links




                        [Non-text portions of this message have been removed]
                      • Kiran
                        Yes,I think content check is also one of excellent options. ... From: corey bailey Subject: Re: [LoadRunner] Forcing an
                        Message 11 of 12 , Mar 3, 2009
                        • 0 Attachment
                          Yes,I think content check is also one of excellent options.

                          --- On Mon, 2/3/09, corey bailey <corey.bailey@...> wrote:

                          From: corey bailey <corey.bailey@...>
                          Subject: Re: [LoadRunner] Forcing an Iteration to Fail
                          To: LoadRunner@yahoogroups.com
                          Date: Monday, 2 March, 2009, 11:55 PM






                          Perhaps we look at if from the other direction, how many fail return codes
                          are there?
                          you could create content checks and list every fail
                          rule; getReturnCode= 1, getReturnCode= 2, getReturnCode= 3, getReturnCode= 5 etc...

                          no more spaghetti code.

                          On Mon, Mar 2, 2009 at 12:43 AM, Stevenson Randy <
                          StevensonRandalJ@ johndeere. com> wrote:

                          > Perhaps I was not as clear as I could have been in my description of my
                          > problem. I have a web_submit_form action function in my script for which I
                          > am trying to verify success or failure. It is not possible to simply use a
                          > web_reg_find statement to check the return because there are two types of
                          > successful return codes sent back from the application: "getReturn code=0"
                          > or "getReturn code=4". So, here is what I have right now:
                          >
                          > int iRC_0, RC_4, iSuccess;
                          >
                          > web_reg_save_ param("RC_ Check_0",
                          > "LB=getReturnCode" ,
                          > "RB=0\n",
                          > "Ord=All",
                          > "NotFound=warning" ,
                          > LAST);
                          >
                          > web_reg_save_ param("RC_ Check_4",
                          > "LB=getReturnCode" ,
                          > "RB=4\n",
                          > "Ord=All",
                          > "NotFound=warning" ,
                          > LAST);
                          >
                          > web_submit_data( "CKCWSv12TestSer vlet",
                          > .....
                          > .....
                          > .....
                          >
                          > iRC_0=atoi(lr_ eval_string( "{RC_Check_ 0_count}" ));
                          >
                          > iRC_4=atoi(lr_ eval_string( "{RC_Check_ 4_count}" ));
                          >
                          > if (iRC_0 == 1) {
                          > lr_vuser_status_ message( "Here I am - 0");
                          > iSuccess=1;
                          > }
                          >
                          > if (iRC_4 == 1) {
                          > lr_vuser_status_ message( "Here I am - 4");
                          > iSuccess=1;
                          > }
                          >
                          > if (iSuccess==0) {
                          >
                          > lr_fail_trans_ with_error( "web_submit_ data failed");
                          > lr_end_transaction( "01_04_CKC_ ClickOn_Enter_ SearchWithLastNa me",LR_AUTO) ;
                          > return;
                          >
                          > }else{
                          >
                          > lr_end_transaction( "01_04_CKC_ ClickOn_Enter_ SearchWithLastNa me",LR_AUTO) ;
                          >
                          > }
                          > As I already conceded, spaghetti code...
                          >
                          > Anyway, if the function finds a return code of 0 or 4, it succeeds as it is
                          > supposed to. However, if it does not get a return code 0 or 4, I see this in
                          > the Playback Log:
                          >
                          > Action.c(114) : Error: Search failed
                          > Action.c(116) : Notify: Transaction
                          > "01_04_CKC_ClickOn_ Enter_SearchWith LastName" ended with "Fail" status
                          > (Duration: 0.3203 Wasted Time: 0.0000).
                          > Ending action Action.
                          > Ending iteration 3.
                          >
                          > But in the "View --> Test Results", all Transactions show as "Passed". So
                          > how can that be? And what do I have to do to make the Iteration fail. My
                          > Test Results should look like this for the first 10 iterations:
                          >
                          > Passed
                          > Passed
                          > Failed
                          > Passed
                          > Failed
                          > Passed
                          > Passed
                          > Passed
                          > Failed
                          > Failed
                          >
                          >
                          > Randy Stevenson
                          > Data & Application Services - Performance Testing Team
                          > Infrastructure Analyst
                          > Deere & Company
                          > 1 John Deere Place
                          > WOB 2NW
                          > Moline, IL 61265
                          > (309) 765-0983
                          > Cell: (309) 737-6385
                          > StevensonRandy@ JohnDeere. com <StevensonRandy% 40JohnDeere. com><mailto:
                          > StevensonRandy@ JohnDeere. com <StevensonRandy% 40JohnDeere. com>>
                          >
                          > "Why is there never enough time to do things right, but always enough time
                          > to do them over?"
                          >
                          > ____________ _________ _________ __
                          > From: LoadRunner@yahoogro ups.com <LoadRunner% 40yahoogroups. com> [mailto:
                          > LoadRunner@yahoogro ups.com <LoadRunner% 40yahoogroups. com>] On Behalf Of
                          > Kiran
                          > Sent: Sunday, March 01, 2009 12:59 PM
                          > To: LoadRunner@yahoogro ups.com <LoadRunner% 40yahoogroups. com>
                          > Subject: Re: [LoadRunner] Forcing an Iteration to Fail
                          >
                          > I am not sure if there is any function in LR which has return code as 0 and
                          > 4,I have seen and used only 2 return codes values and those are 0 for pass
                          > and 1 for fail or it could be vice versa.
                          > well I am not sure what do you mean by iteration failure,if your code says
                          > that it has exit iteration based on failure condition,then it has to
                          > exit.Maybe you might seeing End action as pass in your test results.
                          > Any ways, here is suggestion you should do to debug your code,
                          > first make sure that your conditions are working correctly,do not exit the
                          > iteration even it fails.
                          >
                          > once you know that your code is working correctly,then add exit on failure
                          > clause with iteration.I dont remember the function but its one line
                          > function,just keep it beneath lr_fail transaction and once your condition is
                          > met,i.e transaction fails ,it will exit the iteration.
                          >
                          > It happens sometimes,you just need to have some more patience while you are
                          > dealing with code,frustation and getting panic are one of the worst
                          > behaviour that affects the creative mind.
                          >
                          > if still you cannot do it,assume that either transaction is passing or your
                          > logic is faulty and finally you can also paste the code here,I am assuming
                          > that you have condition where in iteration exits only for failure and not
                          > for success.
                          >
                          > --- On Sat, 28/2/09, Stevenson Randy <StevensonRandalJ@ JohnDeere. com<StevensonRandalJ% 40JohnDeere. com>
                          > <mailto:StevensonRa ndalJ%40JohnDeer e.com<StevensonR andalJ%2540JohnD eere.com> >>
                          > wrote:
                          >
                          > From: Stevenson Randy <StevensonRandalJ@ JohnDeere. com<StevensonRandalJ% 40JohnDeere. com>
                          > <mailto:StevensonRa ndalJ%40JohnDeer e.com<StevensonR andalJ%2540JohnD eere.com>
                          > >>
                          > Subject: [LoadRunner] Forcing an Iteration to Fail
                          > To: "'LoadRunner@ yahoogroups. com <%27LoadRunner% 40yahoogroups. com><mailto:
                          > %27LoadRunner% 40yahoogroups. com>'" <LoadRunner@yahoogro ups.com<LoadRunner% 40yahoogroups. com>
                          > <mailto:LoadRunner% 40yahoogroups. com <LoadRunner% 2540yahoogroups. com>>>
                          > Date: Saturday, 28 February, 2009, 3:59 AM
                          >
                          > Do you ever have those moments when you have used LoadRunner for over 8
                          > years and you cannot for your life remember how to do something simple?
                          > Well, I seem to be having one of those moments.
                          >
                          > I am trying to test for use case success by testing for the return code
                          > from one of my transactions. If the return code is 0 or 4, the transaction
                          > passes. If the return code returns anything else, the transaction, and, more
                          > importantly, the iteration fails.
                          >
                          > I have now successfully built some spaghetti code that issues the error
                          > "Search failed" and says "Transaction "Check" ended with "Fail" status", but
                          > the Iteration shows as a success when I view the Test results...
                          >
                          > This has to be very simple, but what am I forgetting? (and, no, I do not
                          > have Continue on Error activated)
                          >
                          > Arghhh...
                          >
                          > Randy Stevenson
                          > Data & Application Services - Performance Testing Team
                          > Infrastructure Analyst
                          > Deere & Company
                          > 1 John Deere Place
                          > WOB 2NW
                          > Moline, IL 61265
                          > (309) 765-0983
                          > Cell: (309) 737-6385
                          > StevensonRandy@ JohnDeere. com<mailto:Stevenso nRandy@ JohnDeere. com>
                          >
                          > "Why is there never enough time to do things right, but always enough time
                          > to do them over?"
                          >
                          > [Non-text portions of this message have been removed]
                          >
                          > Check out the all-new Messenger 9.0! Go to http://in.messenger .yahoo.com/
                          >
                          > [Non-text portions of this message have been removed]
                          >
                          > [Non-text portions of this message have been removed]
                          >
                          >
                          >

                          --
                          Corey Bailey
                          Principal Consultant
                          Citizencrane Consulting

                          [Non-text portions of this message have been removed]

















                          Add more friends to your messenger and enjoy! Go to http://messenger.yahoo.com/invite/

                          [Non-text portions of this message have been removed]
                        Your message has been successfully submitted and would be delivered to recipients shortly.