Help Key CHECK

  • Hello how to divide the Failure and the Success. If I recive {"js":{"name":"" this is failure but if i get it {"js":{"name":"NAME" or another name this is Success. How to make key check for success if the name is randomly generated ?

  • Admin

    I would do another thing:
    first parse the name using a PARSE block in JSON mode (e.g. parse it to a variable called NAME)
    then in the keycheck you could verify if <NAME> EqualTo nothing (leave empty) or if NotEqualTo nothing. Tick "create empty" in the parse block too, so even if it cannot find it in the response, it will still create an empty variable called NAME.

  • can you give an example in loli script

  • Admin

    PARSE "<SOURCE>" JSON "name" CreateEmpty=FALSE -> VAR "NAME" 
      KEYCHAIN Success OR 
        KEY "<NAME>" NotEqualTo ""
      KEYCHAIN Failure OR 
        KEY "<NAME>" EqualTo ""

Log in to reply