My setup:
Windows 7, 64 bit
Katalon Studio, Version: 6.1.5, Build: 3
When i run the following I get an error as listed below:
import com.sun.jna.platform.FileUtils
File file = new File("C:\\Users\\devers\\Downloads\\TestFiles\\dave.txt")
String text = FileUtils.readFileToString(file)
println text
Error:
06-11-2019 10:55:47 AM Test Cases/0 HOW_TO_CASES/27 How-to read from file
Elapsed time: 0.233s
Test Cases/0 HOW_TO_CASES/27 How-to read from file FAILED.
Reason:
groovy.lang.MissingMethodException: No signature of method: static com.sun.jna.platform.FileUtils.readFileToString() is applicable for argument types: (java.io.File) values: [C:\Users\devers\Downloads\TestFiles\dave.txt]
at 27 How-to read from file.run(27 How-to read from file:4)
at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)
at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)
at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:337)
at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:328)
at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:307)
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:299)
at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:233)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:114)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:105)
at com.kms.katalon.core.main.TestCaseMain$runTestCase$0.call(Unknown Source)
at TempTestCase1560275745973.run(TempTestCase1560275745973.groovy:21)
I do play nice.
I know how addictive is w7 but unfortunately M$ has different opinions. you will see … this year may be the last for his life.
i did use it too, for long time, since the early begining.
lucky me, at home i migrated everything i own to linux and at work i have w10 provided by the company
april 2020 if i remember it right. so, it’ less than a year … you still have time to find alternate options
ok, is not this year but still less than one year
hello, does anyone has an idea how to read a value from the txt file? for example i have a one time passcode that is displayed into a sms.txt, any idea how to get this generated one time passcode an insert it into katalon to write it into the text box?