Strong alliance: Selenium+JMeter for performance testing

There are many mature performance testing tools on the market now, and JMeter is one of them. You can quickly organize the existing Selenium code in the form of performance testing through JMeter, and use JMeter's rich report function to display the test results.

operate

prepare script

We still use the Baidu search script written in the previous article:

from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.by import By
driver = webdriver.Chrome()
driver.get("https://www.baidu.com")
ActionChains(driver).click(driver.find_element(By.XPATH,"//*[text()='新闻']")).perform()

Open JMeter to create a [Thread Group].

Modify the number of threads

Right-click the BaiduSearch thread group to create a BeanShell sampler:

Then fill in the script in the Script area to set the information of the Bean Shell sampler:

Create a listener and run

The basic performance test is organized, and listeners can be created to view the running results. JMeter supports a variety of listeners, which can be selected according to your needs.

In this example, we'll use the "Table Results" listener to view the results of the run.

Remark

Although the performance test can be quickly organized through the above method, the granularity of the performance test is relatively rough, and the performance data span is relatively large, which is only suitable for verifying whether the overall performance of a certain process meets the performance requirements.

Finally:  In order to give back to the die-hard fans, I have compiled a complete software testing video learning tutorial for you. If you need it, you can get it for free【保证100%免费】

insert image description here

Software Testing Interview Documentation

We must study to find a high-paying job. The following interview questions are the latest interview materials from first-tier Internet companies such as Ali, Tencent, and Byte, and some Byte bosses have given authoritative answers. Finish this set The interview materials believe that everyone can find a satisfactory job.

insert image description here

insert image description here

Guess you like

Origin blog.csdn.net/weixin_50829653/article/details/131405934