我在IntelliJ中运行我的加特林脚本时遇到问题。我有多个脚本要执行,其中涉及一次登录,然后其余的脚本/流程。对于前4-5个脚本,一切运行良好,直到遇到此警告->“导入的Login' is permanently hidden by definition of object Login in package actions" in the newly created script. Ever since, every script, that includes even the previously running scripts, has started throwing this warning. As a result, even if I ignore and go ahead with executing the script, it stops moving ahead and remains stuck, later throwing this blockage in the console as well -> imported
Login'被包操作中的对象Login定义永久隐藏。
我遵循了与以前的脚本完全相同的脚本编写实践,与通常的编写没有偏差。
流量:
请帮助。
谢谢!
//Login Action that is being imported to another action below:
package jda.Scheduler.actions
import io.gatling.core.Predef._
import io.gatling.http.Predef._
import scala.concurrent.duration._
object Login {
def loginAction(): ChainBuilder = {
group("Login") {
exec(http("Main_Request")
.post("/******/****/login?loginName=c***&password=****")
.header("Accept", "application/json")
.header("Content-Type", "application/x-www-form-urlencoded")
.header("Accept-Encoding", "gzip")
.header("User-Agent", "okhttp/2.7.5")
.body(StringBody(""""""))
.check(status.in(200))
.check(headerRegex("Set-Cookie", "REFSSessionID(.+?);").find.saveAs("SessionID")))
}
}
}
//Different Action where Login is being imported and issues faced:
package jda.Scheduler.actions
import jda.Scheduler.actions.Login ---> Warning appears (imported 'Login' is permanently hidden by definition of object Login in package actions)
import jda.Scheduler.actions.CreateUserAction ---> Warning appears (imported 'CreateUserAction' is permanently hidden by definition of object CreateUserAction in package actions)
import io.gatling.core.Predef._
import io.gatling.http.Predef._
import scala.concurrent.duration._
object UpdateEmployeeAction {
def updateEmployeeAction(): ChainBuilder = {
group ("updateEmployee"){
exec(http("Main_Request")
.get("/******/****/****/api/***-***/employees/${userID}")
.header("Content-Type", "application/json")
.header("REFSSessionID", "${SessionID}") ---> This part is being captured and saved //in Login action
.body(StringBody("""{
"id": ${userID}, --> This part (${userID}) is being captured and saved in another action, just //like Login Action. Even this is creating same issues.
"badgeNumber": ${userloginname},
"birthDate": "1900-07-31T00:00:00",
"hireDate": "2019-08-12T00:00:00",
"seniorityDate": "2019-08-12T00:00:00",
"minorStatus": "Minor",
"isManagement": false,
"managerPassword": null,
"managerInSchedule": false,
"generateException": true,
"generateAlerts": true,
"canWorkUnassignedJobs": true,
"schedulingTypeCode": "Manual",
"ignoreBiometricValidation": false,
"punchValidationCode": "NoScheduleValidation"
}"""))
.check(status.in(200))
)}}
}