[英]Count items and print in Extents Report's test.log ()
I cannot print a variable of type INT in the test.log () of the extents report and I need this information.我无法在范围报告的 test.log () 中打印 INT 类型的变量,我需要此信息。
@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.我希望您打印报告中的项目数,但您正在打印项目的名称。
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.在这种情况下,您可能希望使用不带括号的 .length 来获取数组中的元素数,而不是使用 not.lenght() 来获取字符串中的字符数。
See https://www.geeksforgeeks.org/length-vs-length-java/见https://www.geeksforgeeks.org/length-vs-length-java/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.