I have an automation service I build and before you run the automation you give it a link so when you start the automation you get first redirect to this link.
On my machine you get redirected perfectly, but on a friend machine the Firefox browser is opened and thats it.
does anyone know what might be the issue?
here is the class that responsible for this:
case class csvUploadData(clientUrl: String)
val csvUploadForm = Form(
mapping(
"clientUrl" -> nonEmptyText)(csvUploadData.apply)(csvUploadData.unapply))
def uploadCSV = Action.async(parse.multipartFormData) { implicit request =>
csvUploadForm.bindFromRequest.fold(
formWithErrors => {
Future {
Redirect(routes.Application.index).flashing(
"error" -> formWithErrors.error("clientUrl").get.message)
}
},
userData => {
request.body.file("csvFile").fold(Future {
Redirect(routes.Application.index).flashing(
"error" -> "Missing CSV file").withSession(request.session)
}) { formFile =>
import java.io.File
val filename = formFile.filename
Future {
val file = formFile.ref.file
val purchaseInfos = purchaseDS(file)
val t = Try {
val driver: WebDriver = new FirefoxDriver
val actions: ActionsHMRC = new ActionsHMRC(driver, userData.clientUrl)
val results = actions.insertData(purchaseInfos)
results.filter(_._2.isFailure)
}
t match {
case Success(failures) =>
val failedMsg = if (failures.nonEmpty)
failures.map{case (pi, err) => s"${pi.invoiceNumber} -> ${err}}"}.mkString("The following rows failed: [\n","\n","\n\n\n]")
else ""
Redirect(routes.Application.index).flashing(
"success" -> s"The file '$filename' automation successfuly.\n$failedMsg")
case Failure(e) =>
println(e)
Redirect(routes.Application.index).flashing (
"error" -> s"The file '$filename' automation failed.")
}
}
}
})
}
}
I have ver 42.0 and he have 43.0.4