How to automate the test scrip for the following scenario Ex: Login screen user entered valid password it should be allowed to login

Login screen user entered an invalid password more than 3 times account will be blocked. I need to automate the test scrip

  • invalid attempts 2 times created the dynamic string data through the pre-request script
  • Valid 3rd attempt I need to pass the valid password .
    Please help me out with the valid attempt scenario using the assertion library