Question: I've one simple jmeter login script for negative scenarios which takes invalid login and password.

It gives JSON response as 
 {
 "status": 401,
 "error": "unauthorised",
 }

The above response is expected.

I've also added the JSON Path Assertion to verify the status code as 401 which validates correctly

Now my target is if I run the test it should pass however its coming as fail status.
Sampler result shows as below

```
  Sample Count: 1
  Error Count: 1

```

How I can make it pass? Is it possible or not?

Answer: 
Try below code 

```
Sub DisplayError()

On Error Resume Next
Dim rng As Range
Set rng = Sheets("Location_Multiple").Range("A1:AL10000")

Dim rngError As Range
Set rngError = rng.SpecialCells(xlCellTypeFormulas, xlErrors)

If Not rngError Is Nothing Then
    For Each cell In rngError
        MsgBox "Please go back and check.... " & cell.Address
    Next
End If
End Sub

```
Use this, change the `LookIn` argument to `xlValues` instead of `xlFormulas`:

```
Selection.Find(What:="#REF!", After:=ActiveCell, LookIn:=xlValues, _
    LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
    MatchCase:=False, SearchFormat:=False).Activate

```

For a bit cleaner implementation:

```
Dim sht as Worksheet
Dim rngSrch as Range
Dim rngErr as Range

Set sht = Sheets("Location_Multiple")
Set rngSrch = sht.Range("A1:AL10000")

Set rngErr = rngSearch.Find(What:="#REF!", After:=ActiveCell, LookIn:=xlFormulas, _
    LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
    MatchCase:=False, SearchFormat:=False)

If Not rngErr Is Nothing Then
    'Do something to the offending cell, like, highlight it:
    rngErr.Interior.ColorIndex = 39
End If

```

Anticipating there may be multiple cells with an error like this, you'll probably have to implement your `.Find` within a `Do...While` loop. There are several examples of that sort of problem on SO. If you have trouble implementing the loop, let me know.