Contributions
Re: GETTING ERROR WHEN USING getDomNodes()
but the actual question why the below error groovy.lang.MissingMethodException: No signature of method: groovy.json.internal.LazyMap.getDomNodes() is applicable for argument types: (java.lang.String) values: [//*] error at line: 28 when will we use[//*]2.1KViews0likes0CommentsRe: GETTING ERROR WHEN USING getDomNodes()
My JDBC response is like below <Results> <ResultSet fetchSize="10"> <Row rowNumber="1"> <V_OBJ_ID>6455a073-29b0-4261-a310-a99b89ef57bb</V_OBJ_ID> <V_OBJ_CODE>TEST_TYPE_5</V_OBJ_CODE> <N_VERSION>1</N_VERSION> <V_AUTH_STATUS>D</V_AUTH_STATUS> </Row> </ResultSet> </Results> But when I use def DBholder = groovyutils.getXmlHolder("JDBC RequestForDatabase#ResponseAsXml") assert DBholder.V_OBJ_ID == json.payload.id I am getting the below error. there is no value forDBholder.V_OBJ_ID com.eviware.soapui.support.XmlHolder@66fa28 (toString() threw java.lang.NullPointerException) error at line: 272.1KViews0likes2CommentsGETTING ERROR WHEN USING getDomNodes()
def json = new JsonSlurper().parseText(response) def groovyutils = new com.eviware.soapui.support.GroovyUtils(context) def DBholder = groovyutils.getXmlHolder("JDBC RequestForDatabase#ResponseAsXml") def xmlUtil = new com.eviware.soapui.support.xml.XmlUtils(); def nodes = json.getDomNodes("//*"); (line 28) Getting the below exception when runing scripts groovy.lang.MissingMethodException: No signature of method: groovy.json.internal.LazyMap.getDomNodes() is applicable for argument types: (java.lang.String) values: [//*] error at line: 28 My response JSON is like below { "payload": { "authstatus": "string", "code": "string", "id": "string", "action_code": "string" } }Solved2.2KViews0likes7Comments- 14KViews0likes0Comments
- 14KViews0likes0Comments
HOW TO READ EXCEL FILE IN GROOVY
I am reading an excel file like below using poi3.6 jars commons-collections4-4.1.jar commons-collections4-4.1-javadoc.jar commons-compress-1.18.jar poi-3.16.jar poi-examples-3.16.jar poi-excelant-3.16.jar poi-ooxml-3.16.jar poi-ooxml-schemas-3.16.jar poi-scratchpad-3.16.jar FileInputStream file = new FileInputStream(new File('D:\\sample.xls')); XSSFWorkbook workbook1 = new XSSFWorkbook(file) XSSFSheet sheet1 = workbook1.getSheetAt(0) Iterator ite = sheet1.rowIterator(); But always getting the error like Thu Jan 31 15:03:13 IST 2019:ERROR:An error occurred [org/openxmlformats/schemas/spreadsheetml/x2006/main/CTExtensionList], see error log for details Is there any other easy method of reading from an excel. Pplease help.Solved14KViews1like4Comments