Reputation: 13
show this msg for me
groovy.lang.MissingMethodException: No signature of method: java.io.File.write() is applicable for 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")
Upvotes: 0
Views: 864
Reputation: 171084
The answer is staring at you from the really helpful error message..
You need to wrap your 62
userid up as a String:
new File( "C:/tc/json/userId_H24_userid.txt" ).write("$userId", "UTF-8")
Upvotes: 2