Junit & Jmeter & Selenium 配置注意事项
来源:互联网 发布:硬笔字 知乎 编辑:程序博客网 时间:2024/04/28 20:00
准备工作:
将文件selenium-java-2.53.1.jar拷贝到JMeter类库安装目录%JMETER_HOME%/lib/下,不需要启动Selenium server.(此处没有使用selenium-server-standalone-2.*.jar)
Jmeter JUnit sampler
将Selenium测试用例打包成.jar文件,并拷贝到%JMETER_HOME%/lib/junit/目录下,注意:测试用例应该继承TestCase or SeleniumTestCase类,从而允许JMeter获取到该测试用例,且测试方法名称应该以test开头。
在Jmeter中创建test group和JUnit sampler测试计划,并在JUnit sampler中选择测试用例的名称,选择测试方法并运行。当然还可以根据需求设置其他参数。
Jmeter版本:3.1
Firefox版本:47.0.1
Selenium版本:2.53.1
一个测试用例例子:
import junit.framework.TestCase;
import org.openqa.selenium.*;
import org.junit.Before;
import org.junit.Test;
import org.junit.After;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxProfile;
public class selenium extends TestCase {
WebDriver driver;
@Before
public void setUp() {
FirefoxProfile profile = new FirefoxProfile();
. . .
driver = new FirefoxDriver(profile);
}
@Test
public void testSelenium_test() throws Exception {
. . .
}
@After
public void tearDown() {
driver.quit();
}
}
0 0
- Junit & Jmeter & Selenium 配置注意事项
- Jmeter配置使用Selenium
- Jmeter注意事项
- selenium testNG jmeter
- selenium-android+junit
- junit+selenium自动化测试
- selenium+testng+junit+eclipse
- java+junit+selenium+Eclipse
- selenium+Junit自动化测试
- JMeter使用注意事项
- jmeter:分布式注意事项
- 自动化selenium--selenium ide 2.0+eclipse+junit
- Junit单元测试注意事项
- Junit Test Case结合Selenium
- Selenium, Eclipse, Junit折腾记
- selenium和junit 的使用
- jmeter配置
- jmeter配置
- POJ 2240 - SPFA - 正权环(最大路)
- 设计模式之责任链模式
- Network Group
- C语言错误处理
- Makefile 中$@ $^ $< 解释
- Junit & Jmeter & Selenium 配置注意事项
- PL/SQL Developer_如何快速获得表名或全部列名的文本形式
- 谷歌浏览器chrom兼容问题
- 一个DVD的小代码
- GridView item0点击卡顿的问题
- 简单的matlab哈哈镜
- 设计模式
- ThinkPad 笔记本电脑Fn的关闭和启用
- git rebase解决提交冲突