In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
Overview
Use jmeter to do a parameterized actual combat today. Iterate through the parameter table through the counter, and then query jdbc to make beanshell assertions.
Involved element
User parameters, counters, regular expressions, jdbc,beanshell scripts
Detailed process
In our opms project management, there is a modification of the project status. The four states are extension, suspension, progress, and termination.
In the case of interface automation, we need to traverse these four states and then make assertions to determine whether the state is modified correctly.
By grasping the interface, we found a law of passing parameters: in addition to the project id, the status of the four states are 1mem2jue 3jp4 respectively.
We extract the return id of the added project with a regular expression as the input parameter of the project status interface. The parameter name is projectid, and this is the primary key id.
Now think about it, for the next four states, how can you do it all at once and assert the result?
The usual practice is to write four interfaces, pass four parameters, and add four assertions, but this will cause a lot of script redundancy and will be despised in interface automation! As follows:
Now we will teach you to use simplified scripts to complete complex logic checks.
1: add a loop controller, let it loop four times, can traverse four states
2: add a user parameter and configure four project states in the parameter table
3: add a counter with an upper limit of 4 and increment 1 to traverse the four states in the parameter table
4: add a http request, traverse the status name in the name, and traverse the status value in the input parameter
5: add a jdbc request to verify that each status change is correctly written to the database by combining the status value of the change and the project id query
6: add a beanshell assertion to determine whether the return value of our database is empty. If not, the assertion is passed, otherwise the assertion fails.
7: run the script, observe the execution effect in the result tree and the log log, traverse four states and assert
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.