Solved
Forum Discussion
richie
Community Hero
Hey Yasar,
Have you tried moving the .toInteger() method outside the setProperty method?
E.g.
testRunner.testCase.testSuite.project.setPropertyValue("id",cin_value).toInteger()
If that doesnt work and it should i believe if thats the only issue (although my groovy skills are poor), you could set to int type separately immediately after the setProperty command.
Try above and report back and i'll suggest the other option i know if above doesnt work, although i think this is correct relative to the error response you got.
Ta
Rich
Have you tried moving the .toInteger() method outside the setProperty method?
E.g.
testRunner.testCase.testSuite.project.setPropertyValue("id",cin_value).toInteger()
If that doesnt work and it should i believe if thats the only issue (although my groovy skills are poor), you could set to int type separately immediately after the setProperty command.
Try above and report back and i'll suggest the other option i know if above doesnt work, although i think this is correct relative to the error response you got.
Ta
Rich
Yasar
4 years agoNew Contributor
Hi richie ,
I've tried moving toInteger() outside setProperty method, like below
testRunner.testCase.testSuite.project.setPropertyValue("country_name",cin_value).toInteger()
and getting below error
java.lang.NullPointerException: cannot invoke method toInteger() on null object error at line: 19
- Yasar4 years agoNew Contributor
Hi richie ,
I've found the mistake, i've created a test suite level property but I used setProperty method on project level property in my groovy script, below works fine
code change:
testRunner.testCase.testSuite.setPropertyValue("country_name",cin_value)
thanks a lot for ur precious time
Related Content
- 6 months agomacheshmeh
Recent Discussions
- 11 hours agoruchisingh