json - Error in groovy script -
show msg me
groovy.lang.missingmethodexception: no signature of method: java.io.file.write() applicable argument types: (java.lang.integer, java.lang.string) values: [62, utf-8] possible solutions: write(java.lang.string, java.lang.string), write(java.lang.string), wait(), size(), canwrite(), wait(long)
and code is
import groovy.json.jsonslurper requestteststepname = "criar/login usuario 1" responsecontent = testrunner.testcase.getteststepbyname(requestteststepname).getpropertyvalue("response") response = new jsonslurper().parsetext(responsecontent) userid = response.userid new file( "c:/tc/json/userid_h24_userid.txt" ).write(userid, "utf-8")
the answer staring @ helpful error message..
you need wrap 62
userid string:
new file( "c:/tc/json/userid_h24_userid.txt" ).write("$userid", "utf-8")
Comments
Post a Comment