0

I cannot print a variable of type INT in the test.log () of the extents report and I need this information.

@Test
    public void CT02_ContandoCategorias() {

        Response response = given().contentType("application/json").get(urlBase);
        test.log(LogStatus.INFO, "Chamando a Api", urlBase);

        List<String> QuantidadeCategorias = response.jsonPath().getList("$");    
    
        test.log(LogStatus.PASS, "Retorno", response.jsonPath().getString("$").length());

    }

I want you to print the number of items in the Report, but you are printing the name of the items.

count itens

Paulo Roberto
  • 1,498
  • 5
  • 19
  • 42

1 Answers1

0

In this case you likely want to use .length without parentheses to get the number of elements in the array and not .lenght() to get the number of characters in the String.

See https://www.geeksforgeeks.org/length-vs-length-java/

Taylor
  • 26
  • 1
  • 2
  • Actually, that's not quite it, the return is a series of words, I want to know how many words it brings me and not how many letters. – Paulo Roberto Aug 17 '20 at 13:09