Idea ID: 2798211

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

Status : Waiting for Votes
Waiting for Votes
See status update history
over 1 year ago

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:

Labels:

Protocols
  • hi again  

    if we have what you said, it will be fantastic and it will cover our needs.

    With you solution we can control what error allow or block, thats for us will be a solution.

     

    regards and thanks you very much 

     

     

  • Hi  

    Yes, that's my point.

    If there's a block list or allow list for HttpErrorsAsWarnings in RTS or API

    For example

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

    web_set_rts_key("key=BlockList", "Value=404,400,501", LAST);//HttpErrors as warnings except for 404 400 501

    or

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

    web_set_rts_key("key=AllowList", "Value=1**,3**,401", LAST);//HttpErrors as warnings only for 1XX, 3XX,401

    Will that meet your requirement?

     

    Regards,

    Wei-Wei Zhang

  • Hi  

    I understand you solution, but for us is a workaround. We can apply this time due to we know that there always we are going to have a error code.

     

    But imagine that you have a request, and depending the return code we need to put as error or as warning.
    Example:
    404, 400, 501 we need to be error
    300,401 we need to be warning.

    with your solutin, you are forcing that all returned codes be warning. and this is why for us is a workaround and not a solution.

    regards

  • 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

  • hi  

     

    We have tried you possible solution, but for us it could be a workaround. we can not control the error code from the http request.

     

    If we know that a request will answered us with known error code, we can apply your workaround, but if we dont know what we will receive, and depending what answer we receive we need the script be FAILED, your solution is not applayable

     

    thank you very much for your help