I am trying to run a couple SQL scripts in a Jmeter SetUp thread. Is it possible to run the SQL code from a .SQL file through Jmeter so I can initialize a database before my other threads get executed. I just don't want to break my code up and copy/paste code inside Jmeter using JDBC connection and JDBC request. Thanks!
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
__FileToString() function seems to be something you're looking for, you can put it inside your JDBC Request sampler and specify path to your .sql file there like:
See Apache JMeter Functions - An Introduction to get familiarized with the JMeter Functions concept