gpt4 book ai didi

scala - 加特林重复 Action

转载 作者:行者123 更新时间:2023-12-04 00:08:27 26 4
gpt4 key购买 nike

我有一个加特林记录,现在我想重复这个场景 10 次,但是我遇到了一些问题,我的重复 Action 只在第一步触发,不会贯穿整个场景。我可以知道它有什么问题吗?我需要在每一步都添加 repeat(10){} 吗?下面是我的 Scala 代码。

class Portal_Selfcare_TelephoneLine_Test1 extends Simulation {

val httpConf = httpConfig
.baseURL("http://10.14.24.29:7281")
.acceptHeader("text/html, application/xhtml+xml, */*")
.acceptEncodingHeader("gzip, deflate")
.acceptLanguageHeader("en-US")
.userAgentHeader("Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0; managedpc)")


val headers_1 = Map(
"Accept-Encoding" -> """gzip, deflate, peerdist""",
"X-P2P-PeerDist" -> """Version=1.0"""
)

val headers_3 = Map(
"Content-Type" -> """application/x-www-form-urlencoded""",
"Pragma" -> """no-cache"""
)


val scn = scenario("New_Install_TelLine")
.repeat(10)
{
exec(http("Browse_URL")
.get("/iCarePrimePortal/selfcare.portal")
.headers(headers_1)
.queryParam("""_nfls""", """false""")
.queryParam("""_nfpb""", """true""")
.queryParam("""_pageLabel""", """selfcare_cus_bk""")
)
.pause(3)
.exec(http("Click_ServiceRegistration")
.get("/iCarePrimePortal/selfcare.portal")
.headers(headers_1)
.queryParam("""_nfls""", """false""")
.queryParam("""_nfpb""", """true""")
.queryParam("""_pageLabel""", """selfcare_consumer_serviceregistration""")
)
.pause(2)
.exec(http("SelectProduct_TelLine")
.post("/iCarePrimePortal/selfcare.portal")
.headers(headers_3)
.queryParam("""_windowLabel""", """s_con_registration_preorder""")
.queryParam("""s_con_registration_preorder_actionOverride""", """/portlets/ordercapture/preorder/begin""")
.queryParam("""_nfpb""", """true""")
.param("""s_con_registration_preorder{pageFlow.userCategory}""", """Customer""")
.param("""s_con_registration_preorderwlw-select_key:{pageFlow.product}OldValue""", """true""")
.param("""s_con_registration_preorderwlw-select_key:{pageFlow.product}""", """Telephony - Home Line""")
.param("""s_con_registration_preorderwlw-select_key:{actionForm.quantityBField}OldValue""", """true""")
.param("""s_con_registration_preorderwlw-select_key:{actionForm.quantityBField}""", """1""")
.param("""s_con_registration_preorderwlw-select_key:{actionForm.quantityRField}OldValue""", """true""")
.param("""s_con_registration_preorderwlw-select_key:{actionForm.quantityRField}""", """1""")
.param("""s_con_registration_preorderwlw-select_key:{actionForm.quantityB3Field}OldValue""", """true""")
.param("""s_con_registration_preorderwlw-select_key:{actionForm.quantityR3Field}OldValue""", """true""")
.param("""s_con_registration_preorderactionOverride:productCheck""", """Next""")
)
.pause(8)
.exec(http("Fill_CustomerDetails")
.post("/iCarePrimePortal/selfcare.portal")
.headers(headers_3)
.queryParam("""_windowLabel""", """s_con_registration_preorder""")
.queryParam("""s_con_registration_preorder_actionOverride""", """/portlets/ordercapture/preorder/planCheck""")
.queryParam("""_nfpb""", """true""")
.param("""s_con_registration_preorderwlw-select_key:{actionForm.customerCategory}OldValue""", """true""")
.param("""s_con_registration_preorderwlw-select_key:{actionForm.customerCategory}""", """Personal""")
.param("""s_con_registration_preorderwlw-select_key:{actionForm.planName}OldValue""", """true""")
.param("""s_con_registration_preorderwlw-select_key:{actionForm.planName}""", """No Call Plan""")
.param("""s_con_registration_preorderwlw-select_key:{actionForm.identityIdPrefix}OldValue""", """true""")
.param("""s_con_registration_preorderwlw-select_key:{actionForm.identityIdPrefix}""", """New NRIC""")
.param("""s_con_registration_preorder{actionForm.identityID}""", """870609-10-8907""")
.param("""s_con_registration_preorder{actionForm.identityIDP}""", """""")
.param("""s_con_registration_preorder{actionForm.identityIDPo}""", """""")
.param("""s_con_registration_preorder{actionForm.identityIDM}""", """""")
.param("""s_con_registration_preorder{actionForm.oldNric}""", """""")
.param("""s_con_registration_preorder{actionForm.customerName}""", """""")
.param("""s_con_registration_preorderactionOverride:preServiceCheck""", """Submit""")
)
.pause(1)
.exec(http("Choose_State")
.post("/iCarePrimePortal/selfcare.portal")
.headers(headers_3)
.queryParam("""_windowLabel""", """s_con_registration_preorder""")
.queryParam("""s_con_registration_preorder_actionOverride""", """/portlets/nisAddressSearch/changeState""")
.queryParam("""_nfpb""", """true""")
.param("""s_con_registration_preorder{actionForm.selectedState}""", """SELANGOR""")
.param("""s_con_registration_preorderactionOverride:changeState""", """SELANGOR""")
)
.pause(9)
.exec(http("Search_Address")
.post("/iCarePrimePortal/selfcare.portal")
.headers(headers_3)
.queryParam("""_windowLabel""", """s_con_registration_preorder""")
.queryParam("""s_con_registration_preorder_actionOverride""", """/portlets/nisAddressSearch/searchAddressByStreet""")
.queryParam("""_nfpb""", """true""")
.param("""s_con_registration_preorder{actionForm.selectedState}""", """SELANGOR""")
.param("""s_con_registration_preorderwlw-select_key:{actionForm.streetType}OldValue""", """true""")
.param("""s_con_registration_preorderwlw-select_key:{actionForm.streetType}""", """JALAN""")
.param("""s_con_registration_preorder{actionForm.streetName}""", """bunga""")
)
.pause(4)
.exec(http("Select_Address")
.get("/iCarePrimePortal/selfcare.portal")
.headers(headers_1)
.queryParam("""_windowLabel""", """s_con_registration_preorder""")
.queryParam("""s_con_registration_preorderaddressId""", """12""")
.queryParam("""s_con_registration_preorder_actionOverride""", """/portlets/nisAddressSearch/selectAddress""")
.queryParam("""_nfpb""", """true""")
)
.pause(4)
.exec(http("Proceed_ServiceCheck")
.post("/iCarePrimePortal/selfcare.portal")
.headers(headers_3)
.queryParam("""_windowLabel""", """s_con_registration_preorder""")
.queryParam("""s_con_registration_preorder_actionOverride""", """/portlets/nisAddressSearch/proceedWithServiceCheck""")
.queryParam("""_nfpb""", """true""")
.param("""s_con_registration_preorderactionOverride:proceedWithServiceCheck""", """Next""")
)
.pause(1)
.exec(http("Show_Result")
.post("/iCarePrimePortal/selfcare.portal")
.headers(headers_3)
.queryParam("""_windowLabel""", """s_con_registration_preorder""")
.queryParam("""s_con_registration_preorder_actionOverride""", """/portlets/ordercapture/preorder/showResult""")
.queryParam("""_nfpb""", """true""")
.param("""s_con_registration_preorderactionOverride:goToTandCs""", """Proceed to Order""")
)
.pause(3)
.exec(http("Proceed_Order")
.post("/iCarePrimePortal/selfcare.portal")
.headers(headers_3)
.queryParam("""_windowLabel""", """s_con_registration_preorder""")
.queryParam("""s_con_registration_preorder_actionOverride""", """/portlets/ordercapture/preorder/goToOC""")
.queryParam("""_nfpb""", """true""")
.param("""s_con_registration_preorderwlw-checkbox_key:{pageFlow.acceptTandCs}OldValue""", """false""")
.param("""s_con_registration_preorderwlw-checkbox_key:{pageFlow.acceptTandCs}""", """on""")
.param("""s_con_registration_preorderactionOverride:goToOC""", """Next""")
)
.pause(2)
.exec(http("Pick_Number")
.post("/iCarePrimePortal/selfcare.portal")
.headers(headers_3)
.queryParam("""_windowLabel""", """s_con_registration_preorder""")
.queryParam("""s_con_registration_preorder_actionOverride""", """/portlets/ordercapture/verifyPickNumber""")
.queryParam("""_nfpb""", """true""")
.param("""s_con_registration_preorderwlw-checkbox_group_key:{actionForm.selectedServiceNumbers}""", """00390192953""")
.param("""s_con_registration_preorderwlw-checkbox_group_key:{actionForm.selectedServiceNumbers}OldValue""", """true""")
.param("""s_con_registration_preorderactionOverride:verifyPickNumber""", """Next""")
)
.pause(32)
.exec(http("Fill_CustomerInfo")
.post("/iCarePrimePortal/selfcare.portal")
.headers(headers_3)
.queryParam("""_windowLabel""", """s_con_registration_preorder""")
.queryParam("""s_con_registration_preorder_actionOverride""", """/portlets/ordercapture/verifyOrderDetails""")
.queryParam("""_nfpb""", """true""")
.param("""s_con_registration_preorder{actionForm.fullName}""", """ROTAN""")
.param("""s_con_registration_preorder{actionForm.identityIdPrefix}""", """New NRIC""")
.param("""s_con_registration_preorder{actionForm.identityId}""", """870609-10-8907""")
.param("""s_con_registration_preorder{actionForm.countryCode}""", """""")
.param("""s_con_registration_preorder{actionForm.acctCategory}""", """Personal""")
.param("""s_con_registration_preorderwlw-select_key:{actionForm.gender}OldValue""", """true""")
.param("""s_con_registration_preorderwlw-select_key:{actionForm.gender}""", """Male""")
.param("""s_con_registration_preorderwlw-select_key:{actionForm.religion}OldValue""", """true""")
.param("""s_con_registration_preorderwlw-select_key:{actionForm.religion}""", """Christian""")
.param("""s_con_registration_preorderwlw-select_key:{actionForm.race}OldValue""", """true""")
.param("""s_con_registration_preorderwlw-select_key:{actionForm.race}""", """Chinese""")
.param("""s_con_registration_preorder{actionForm.dateOfBirth}""", """""")
.param("""s_con_registration_preorderwlw-select_key:{actionForm.nationality}OldValue""", """true""")
.param("""s_con_registration_preorderwlw-select_key:{actionForm.nationality}""", """Citizen""")
.param("""s_con_registration_preorder{actionForm.emailAddress}""", """""")
.param("""s_con_registration_preorderwlw-checkbox_key:{actionForm.enrollTMRewards}OldValue""", """false""")
.param("""s_con_registration_preorder{actionForm.hul}""", """L-4-52""")
.param("""s_con_registration_preorder{actionForm.floorNo}""", """""")
.param("""s_con_registration_preorder{actionForm.buildingName}""", """APT TERATAI BLOK L""")
.param("""s_con_registration_preorder{actionForm.streetType}""", """JALAN""")
.param("""s_con_registration_preorder{actionForm.streetName}""", """BUNGA RAYA""")
.param("""s_con_registration_preorder{actionForm.section}""", """TAMAN BUNGA RAYA""")
.param("""s_con_registration_preorder{actionForm.city}""", """SERENDAH""")
.param("""s_con_registration_preorder{actionForm.postcode}""", """48300""")
.param("""s_con_registration_preorder{actionForm.state}""", """SELANGOR""")
.param("""s_con_registration_preorder{actionForm.country}""", """MALAYSIA""")
.param("""s_con_registration_preorderwlw-select_key:{actionForm.homePhonePrefix}OldValue""", """true""")
.param("""s_con_registration_preorderwlw-select_key:{actionForm.homePhonePrefix}""", """Please select""")
.param("""s_con_registration_preorder{actionForm.homePhone}""", """""")
.param("""s_con_registration_preorderwlw-select_key:{actionForm.officePhonePrefix}OldValue""", """true""")
.param("""s_con_registration_preorderwlw-select_key:{actionForm.officePhonePrefix}""", """Please select""")
.param("""s_con_registration_preorder{actionForm.officePhone}""", """""")
.param("""s_con_registration_preorderwlw-select_key:{actionForm.mobilePhonePrefix}OldValue""", """true""")
.param("""s_con_registration_preorderwlw-select_key:{actionForm.mobilePhonePrefix}""", """014""")
.param("""s_con_registration_preorder{actionForm.mobilePhone}""", """5678905""")
.param("""s_con_registration_preorder{actionForm.contactName}""", """Rotan""")
.param("""s_con_registration_preorderwlw-select_key:{actionForm.mobileNumberPrefix}OldValue""", """true""")
.param("""s_con_registration_preorderwlw-select_key:{actionForm.mobileNumberPrefix}""", """014""")
.param("""s_con_registration_preorder{actionForm.mobileNumber}""", """5678905""")
.param("""s_con_registration_preorder{actionForm.contactEmail}""", """rotan@gmail.com""")
.param("""s_con_registration_preorder{actionForm.orderRemarks}""", """""")
.param("""s_con_registration_preorderactionOverride:verifyOrderDetails""", """Next""")
)
.pause(5)
.exec(http("Submit_Order")
.post("/iCarePrimePortal/selfcare.portal")
.headers(headers_3)
.queryParam("""_windowLabel""", """s_con_registration_preorder""")
.queryParam("""s_con_registration_preorder_actionOverride""", """/portlets/ordercapture/goToOrderSummary""")
.queryParam("""_nfpb""", """true""")
.param("""s_con_registration_preorderactionOverride:gotoSubmitOrderOrRewardsTnc""", """Submit""")
)
.pause(2)
.exec(http("View_Confirmation")
.get("/iCarePrimePortal/portlets/ordercapture/preorder/PreOrderController.portlet")
.headers(headers_1)
.queryParam("""s_con_registration_preorder_netui:returnActionViewRenderer""", """org.apache.beehive.netui.tags.internal.ReturnActionViewRenderer""")
.queryParam("""s_con_registration_preorder_netui:returnActionCallback""", """Netui_OnPopupDone""")
.queryParam("""_portlet.themeAltSkeleton""", """true""")
.queryParam("""_portlet.title""", """Preordercontroller""")
.queryParam("""s_con_registration_preorder_actionOverride""", """/portlets/ordercapture/viewConfirmation""")
.queryParam("""_portlet.themeName""", """plain""")
.queryParam("""_portlet.contentType""", """text/html; charset=UTF-8""")
.queryParam("""s_con_registration_preorderjpfScopeID""", """s_con_registration_preorder""")
.queryParam("""_portlet.lafUniqueId""", """icareprime3DefinitionLabel_1""")
.queryParam("""_portlet.contentOnly""", """true""")
.queryParam("""_portlet.contentMode""", """FULL""")
.queryParam("""_portlet.portalId""", """selfcare_portal""")
.queryParam("""_windowLabel""", """s_con_registration_preorder""")
.queryParam("""_portlet.themeAltSkin""", """true""")
.queryParam("""_nfpsid""", """/portlets/ordercapture/viewConfirmation""")
.queryParam("""_portlet.portalUrl""", """/iCarePrimePortal/selfcare.portal""")
.queryParam("""_nfpb""", """true""")
.queryParam("""_portlet.asyncMode""", """compat_9_2""")
)
}
setUp(scn.users(10).protocolConfig(httpConf))
}

最佳答案

我不确定你是否解决了你的问题。我遇到了同样的问题,禁用缓存对我有用。

套装disableCaching参数给您的 httpProtocol配置,像这样:

val httpConf = http
.acceptHeader("application/json")
.acceptLanguageHeader("en-US,en;q=0.5")
.acceptEncodingHeader("gzip, deflate")
.disableWarmUp
.disableCaching

关于scala - 加特林重复 Action ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23285801/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com