Idea ID: 2798211

Need after check "mark http erros as warnings" the script be PASSED

Status: Delivered

Solution offered by scripting.

See status update history

In some aplication that we are testing, it is normal to get some error code like 403 or 422. In these cases we mark the transaction as "Pass" using the "lr_set_transaction_status(LR_PASS)"

For avoid these situation, we have used "lr_continue_on_error" to be able to continue executing the script and "lr_set_transacion_status (LR_PASS)" to mark as "PASS" the transaction.

But with these 2 workaround, we have continue our script running and we have put the transaction to PASSED but our script status still been FAILED.

We need a function to change the final script status to PASSED if we have changed any transaction to from FAILED to PASSED.

Tags:

Parents
  • Hi  

    You don't have to know the specific error code.

    "HttpErrorsAsWarnings" will make all http error code as warning, including 403 404 4xx and so on...

    If your requirement is 

    lr_start_transaction("DoSomething");
    web_url("step1",...);

    web_url("step2"...);

    ...

    web_url("stepN"...);
    lr_end_transaction("DoSomething", LR_PASS);

    to make "step1"~"stepN" ignore http errors and "pass".

     

    I think

    lr_start_transaction("DoSomething");

    web_set_rts_key("key=HttpErrorsAsWarnings", "Value=1", LAST);//Enable HttpErrorsAsWarnings
    web_url("step1",...);

    web_url("step2"...);

    ...

    web_url("stepN"...);

    web_set_rts_key("key=HttpErrorsAsWarnings", "Value=0", LAST); //Disable HttpErrorsAsWarnings

    lr_end_transaction("DoSomething", LR_PASS);

    meets your requirement.

     

    I said "404" in my last comment just for example.

    It doesn't mean HttpErrorsAsWarnings only works for 404 or specific error code.

     

    If your requirement is "only bypass 403 and 422, and mark other code as failed".

    That will be an enhancement of HttpErrorsAsWarnings , because it has no block list or allow list up to now.

     

    Let's make it clear that the requirement is

    "I don't want http errors make script failed for some reason"

    or

    "It's nothing to do with http or web steps. I just want make the script result be SUCCESS"

     

    Regards,

    Wei-Wei Zhang

Comment
  • Hi  

    You don't have to know the specific error code.

    "HttpErrorsAsWarnings" will make all http error code as warning, including 403 404 4xx and so on...

    If your requirement is 

    lr_start_transaction("DoSomething");
    web_url("step1",...);

    web_url("step2"...);

    ...

    web_url("stepN"...);
    lr_end_transaction("DoSomething", LR_PASS);

    to make "step1"~"stepN" ignore http errors and "pass".

     

    I think

    lr_start_transaction("DoSomething");

    web_set_rts_key("key=HttpErrorsAsWarnings", "Value=1", LAST);//Enable HttpErrorsAsWarnings
    web_url("step1",...);

    web_url("step2"...);

    ...

    web_url("stepN"...);

    web_set_rts_key("key=HttpErrorsAsWarnings", "Value=0", LAST); //Disable HttpErrorsAsWarnings

    lr_end_transaction("DoSomething", LR_PASS);

    meets your requirement.

     

    I said "404" in my last comment just for example.

    It doesn't mean HttpErrorsAsWarnings only works for 404 or specific error code.

     

    If your requirement is "only bypass 403 and 422, and mark other code as failed".

    That will be an enhancement of HttpErrorsAsWarnings , because it has no block list or allow list up to now.

     

    Let's make it clear that the requirement is

    "I don't want http errors make script failed for some reason"

    or

    "It's nothing to do with http or web steps. I just want make the script result be SUCCESS"

     

    Regards,

    Wei-Wei Zhang

Children
No Data