JMeter是用Java开发的桌面性能测试工具。直接有Jar包可以导入到Java项目中,自然可以很好地与Selenium WebDriver、JUnit集成。
- Export yourTestProject.jar and set the export destination to where JMeter is installed
- And the last thing need to be done before running the test is to copy the webdriver libraries to the Jmeter’s lib folder.
- Now start up JMeter and create a basic test plan by adding a “thread group” and a “Once Only” logic controller to it.
- To be able to run JUnit test we should add a “JUnit Request” to the Once only logic controller.
If the earlier steps were correctly done the export class should appear on the JUnit Request configuration page, and you can choose the Test Method – the one with the @Test annotation – from the list.