I need to inject a failed request like from this post from 2013:
.exec(session => {
import com.excilys.ebi.gatling.core.result.writer.DataWriter
import com.excilys.ebi.gatling.core.util.TimeHelper.nowMillis
import com.excilys.ebi.gatling.core.result.message.RequestStatus.{ OK, KO }
val cookiePresent = CookieHandling.getStoredCookies(session, REQUESTED_PAGE_URL).contains((c: Cookie) => { c.getName.startsWith(COOKIE_NAME_PREFIX) })
val now = nowMillis
val status = if (cookiePresent) OK else KO
DataWriter.logRequest( session.scenarioName,
session.userId,
“Cookie Check”,
now,
now,
now,
now,
status)
session
})
However, these libraries no longer exist and I don’t seem them in the existing Gatling libraries. Does anyone know how I can accomplish this with the current libraries?
Thanks,
Jason