We wanted to find the name of the test case which has failed ( here test case having name G)
the test case having system-out passes and the test case having failure message fails. So we tried writing a script in painless but it does not work. Following is the script:
String scenario = "NA";
for(int i = 0; i < xml_parsed.testcase.length; i++){
if(xml_parsed.testcase[i].system-out == NULL)
return xml_parsed.testcase[i].name;
}
return scenario;
We tried doc['xml_parsed.testcase.keyword'] but xml_parsed.testcase.keyword does not exist i guess as it is not shown in the fields when the index pattern is created. In discover xml_parsed.testcase appears as follows;
Hi Jayesh, It's hard to say, since the code you pasted got garbled. But if you're trying to ask: "How many documents have a testcase with name 'G'?" You can do this without needing array index access.
In Kibana's Dev Tools, you can do something like this:
We wanted to find the name of the test case which has failed ( here test case having name G).
The test case having <!system-out> passes and the test case having <!failure> message fails. So we tried writing a script in painless but it does not work. Following is the script:
String scenario = "NA";
for(int i = 0; i < xml_parsed.testcase.length; i++){
if(xml_parsed.testcase[i].system-out == NULL)
return xml_parsed.testcase[i].name;
}
return scenario;
We tried doc['xml_parsed.testcase.keyword'] but xml_parsed.testcase.keyword does not exist i guess as it is not shown in the fields when the index pattern is created. In discover xml_parsed.testcase appears as follows;
So how to access the fields within an index in the array for example "name" in xml_parsed.testcase[0]?
We want the name of the testcase which has failure field .here it is G but it can vary. So can you tell us how to do that in painless because we want to create a field and use that field to visualize.Have added ! inside the tags just to make it visible.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.