Please do apologize as i cannot send the exact scala class file which i am using in my project
Object Login { val login = …….}
Object Actions{val actions = }
object dbQuery {
val csvFileLocation = "<path>"
val out = new BufferedWriter(new FileWriter(csvFileLocation)).append("IDS" + "\n")
val writer = new CSVWriter(out, CSVWriter.NO_QUOTE_CHARACTER, CSVWriter.NO_ESCAPE_CHARACTER, "\n")
val scn1 = //scenario("Database Query")
{
var i = 0
feed(jdbcFeeder("jdbc:oracle:thin:<jdbc connection details, username, password, sql>))
.exec { session =>
val Ids = new Array[String]((jdbcFeeder("<jdbc connection details, username, password, sql>”).records.length))
println("Ids", Ids)
Ids(i) = session("IDS").as[Long].toString + "," +"\n"
println(Ids(i))
writer.writeNext(Ids)
i = i + 1
session
}
}
after {
writer.close()
}
val scn = scenario("Case")
.group("login"){
exec( Login.login)
}
.group("actions"){
exec(Actions.actions)
}
.group("dbQuery"){
exec(dbQuery.scn1)
}
.exec(flushHttpCache)
.exec(flushCookieJar)
.exec(flushSessionCookies)
setUp(
scn.inject(atOnceUsers(1)).protocols(httpProtocol)
)
What is happening is that the Database query is run first and then the other stuffs.