bannerywj 发表于 2008-9-3 13:25:49

loadrunner脚本循环执行问题

请教一个问题,我用loadrunner录制的脚本并设置了参数,run了10次,但怎么只有第一次执行脚本的数据改变了,其他几次都没有执行修改,问题出在那里呢?请大家指教

杀手太冷 发表于 2008-9-3 13:51:27

你得把你得录制方法和 脚本发出来呀 ,不然大家怎么帮你分析得 ~~~~~~~~~~~~~~~

bannerywj 发表于 2008-9-3 18:01:46

Action()
{

        web_url("login.jsp",
                "URL=http://169.7.174.227:9080/cpos/jsp/common/login.jsp",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=",
                "Snapshot=t1.inf",
                "Mode=HTML",
                LAST);

        lr_think_time(5);

        web_submit_form("login.do",
                "Snapshot=t2.inf",
                ITEMDATA,
                "Name=enl", "Value=zhijunzhan", ENDITEM,
                "Name=password", "Value=xxxxx", ENDITEM,
                "Name=roleId", "Value=Distributor Owner", ENDITEM,
                "Name=siteId", "Value=China I&TB", ENDITEM,
                LAST);

        web_link("é”\x80å”\xAE\xE7»´æŠ\xA4",
                "Text=é”\x80å”\xAE\xE7»´æŠ\xA4",
                "Snapshot=t3.inf",
                EXTRARES,
                "Url=images/utilities/nav_line.gif", "Referer=http://169.7.174.227:9080/cpos/maintainSaleToCompanyCustomerAction.do?expandId=0,1", ENDITEM,
                "Url=images/search1.gif", "Referer=http://169.7.174.227:9080/cpos/maintainSaleToCompanyCustomerAction.do?expandId=0,1", ENDITEM,
                LAST);

        web_link("é”\x80å”\xAE\xE4¿¡æ\xAF\xE6Ÿ¥è¯\xA2",
                "Text=é”\x80å”\xAE\xE4¿¡æ\xAF\xE6Ÿ¥è¯\xA2",
                "Snapshot=t4.inf",
                LAST);

        web_submit_form("searchSale.do",
                "Snapshot=t5.inf",
                ITEMDATA,
                "Name=searchCriteria.saleTypeID", "Value=0", ENDITEM,
                "Name=searchCriteria.customerName", "Value=", ENDITEM,
                "Name=searchCriteria.buyerName", "Value=", ENDITEM,
                "Name=searchCriteria.commodityCode", "Value=", ENDITEM,
                "Name=searchCriteria.productCategoryName", "Value=", ENDITEM,
                "Name=searchCriteria.productName", "Value=", ENDITEM,
                "Name=searchCriteria.skuID", "Value=", ENDITEM,
                "Name=searchCriteria.customerOrderNumber", "Value=", ENDITEM,
                "Name=searchCriteria.invoiceNumber", "Value=", ENDITEM,
                "Name=searchCriteria.application", "Value=", ENDITEM,
                "Name=searchCriteria.operator", "Value==", ENDITEM,
                "Name=priceDisplay", "Value=", ENDITEM,
                LAST);

        lr_think_time(11);

        web_link("{link}",
                "Text={link}",
                "Snapshot=t6.inf",
                LAST);

        lr_think_time(13);

        web_submit_data("maintainSaleToCompanyCustomerAction.do",
                "Action=http://169.7.174.227:9080/cpos/maintainSaleToCompanyCustomerAction.do?action=modify",
                "Method=POST",
                "RecContentType=text/html",
                "Referer=http://169.7.174.227:9080/cpos/maintainSaleToCompanyCustomerAction.do?saleID=3176&saleLineItemId=3337&action=view",
                "Snapshot=t7.inf",
                "Mode=HTML",
                ITEMDATA,
                "Name=lookupName", "Value=64", ENDITEM,
                "Name=maintenanceMode", "Value=modify", ENDITEM,
                "Name=presentable.maintenanceKey.saleID", "Value=3176", ENDITEM,
                "Name=presentable.saleTypeID", "Value=20", ENDITEM,
                "Name=presentable.saleStatusID", "Value=10", ENDITEM,
                "Name=presentable.lastModifiedDate", "Value=1158336000000", ENDITEM,
                "Name=presentable.createdDate", "Value=1157904000000", ENDITEM,
                "Name=presentable.requireApproval", "Value=true", ENDITEM,
                "Name=mode", "Value=view", ENDITEM,
                "Name=active", "Value=null", ENDITEM,
                "Name=presentable.seller.maintenanceKey.userID", "Value=11", ENDITEM,
                "Name=presentable.saleDate", "Value=2006-09-06", ENDITEM,
                "Name=firstName", "Value=", ENDITEM,
                "Name=state", "Value=", ENDITEM,
                "Name=district", "Value=", ENDITEM,
                "Name=street", "Value=", ENDITEM,
                "Name=streetNumber", "Value=", ENDITEM,
                "Name=postalCode", "Value=", ENDITEM,
                "Name=phone", "Value=", ENDITEM,
                "Name=mobile", "Value=", ENDITEM,
                "Name=email", "Value=", ENDITEM,
                "Name=companyName", "Value=", ENDITEM,
                "Name=presentable.customer.lastName", "Value=东莞泰升制é\x80 åŽ‚", ENDITEM,
                "Name=presentable.customer.customerCode", "Value=", ENDITEM,
                "Name=presentable.customer.customerID", "Value=801", ENDITEM,
                "Name=presentable.customer.marketID", "Value=78", ENDITEM,
                "Name=presentable.customer.marketName", "Value=工业-其它市场", ENDITEM,
                "Name=presentable.customer.city", "Value=东莞å¸\x82", ENDITEM,
                "Name=presentable.customerOrderNumber", "Value=", ENDITEM,
                "Name=presentable.invoiceNumber", "Value=", ENDITEM,
                "Name=presentable.saleLineItems.collection.dataCopy.maintenanceKey.saleLineItemID", "Value=3337", ENDITEM,
                "Name=presentable.saleLineItems.collection.dataCopy.saleID", "Value=3176", ENDITEM,
                "Name=presentable.saleLineItems.collection.dataCopy.productID", "Value=1300", ENDITEM,
                "Name=presentable.saleLineItems.collection.dataCopy.commodityID", "Value=17", ENDITEM,
                "Name=presentable.saleLineItems.collection.dataCopy.application", "Value=", ENDITEM,
                "Name=presentable.saleLineItems.collection.dataCopy.non3MStandard", "Value=", ENDITEM,
                "Name=presentable.saleLineItems.collection.dataCopy.totalPriceWithoutVAT", "Value=0.0", ENDITEM,
                "Name=presentable.saleLineItems.collection.dataCopy.quantity", "Value=0.06", ENDITEM,
                "Name=presentable.saleLineItems.collection.dataCopy.status", "Value=10", ENDITEM,
                "Name=presentable.saleLineItems.collection.maintenanceKey.saleLineItemID", "Value=3337", ENDITEM,
                "Name=presentable.saleLineItems.collection.saleID", "Value=3176", ENDITEM,
                "Name=presentable.saleLineItems.collection.status", "Value=10", ENDITEM,
                "Name=presentable.saleLineItems.collection.commodityCode", "Value=2790", ENDITEM,
                "Name=presentable.saleLineItems.collection.commodityID", "Value=17", ENDITEM,
                "Name=presentable.saleLineItems.collection.productCategory", "Value=4930P", ENDITEM,
                "Name=presentable.saleLineItems.collection.productCategoryID", "Value=354", ENDITEM,
                "Name=presentable.saleLineItems.collection.productName", "Value=4930P VHB D/C TAPE 610MMX33M(VIA SZ CO.)", ENDITEM,
                "Name=presentable.saleLineItems.collection.productID", "Value=1300", ENDITEM,
                "Name=presentable.saleLineItems.collection.inventory", "Value=-6011.25", ENDITEM,
                "Name=presentable.saleLineItems.collection.sku", "Value=XT000524923", ENDITEM,
                "Name=presentable.saleLineItems.collection.application", "Value=", ENDITEM,
                "Name=presentable.saleLineItems.collection.quantity", "Value=0.78", ENDITEM,
                "Name=presentable.saleLineItems.collection.unit", "Value=RL", ENDITEM,
                "Name=presentable.saleLineItems.collection.non3MStandard", "Value=", ENDITEM,
                "Name=presentable.saleLineItems.collection.totalPriceWithoutVAT", "Value=0.0", ENDITEM,
                LAST);

        web_submit_data("searchSale.do_2",
                "Action=http://169.7.174.227:9080/cpos/searchSale.do?backstatus=back",
                "Method=POST",
                "RecContentType=text/html",
                "Referer=http://169.7.174.227:9080/cpos/maintainSaleToCompanyCustomerAction.do?action=modify",
                "Snapshot=t8.inf",
                "Mode=HTML",
                ITEMDATA,
                LAST);

        return 0;
}
以上是录制的脚本,我是要批量修改销售记录,将每行的销售ID设为参数,但在回放的时候确只执行了参数中的第一行,其他没有执行
   web_link("{link}",
  "Text={link}",

mansart 发表于 2008-9-3 18:08:39

原帖由 bannerywj 于 2008-9-3 13:25 发表 http://bbs.51testing.com/images/common/back.gif
请教一个问题,我用loadrunner录制的脚本并设置了参数,run了10次,但怎么只有第一次执行脚本的数据改变了,其他几次都没有执行修改,问题出在那里呢?请大家指教
应该是参数的取值模式设的不对造成的。例如select next rowupdate value on 的设置。
你还是先看看这方面的资料吧
页: [1]
查看完整版本: loadrunner脚本循环执行问题