JMeter Selenium Automation code for pressure measurement

Source: Internet
Author: User

Original reprint: Http://www.blogjava.net/qileilove/archive/2014/06/05/414423.html preparation: selenium-server-standalone-2.* the file.  The jar is copied to the JMETER Class Library installation directory%jmeter_home%/lib/, and you do not need to start selenium server. Jmeter JUnit Sampler Package The selenium test case into a. jar file and copy it to the%jmeter_home%/lib/junit/directory, note: The test case should inherit testcase or  The Seleniumtestcase class, which allows the jmeter to get to the test case, and the test method name should begin with testing. Create the test group and JUnit Sampler testing plan in JMeter, and select the test case name in JUnit sampler, select the test method and run it.  Of course, you can also set additional parameters as required. A test case example:
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; @Beforepublic void SetUp () {Firefoxprofile profile = new Firefoxprofile (); .... driver = new Firefoxdriver (profile);} @Testpublic void Testselenium_test () throws Exception {...} @Afterpublic void TearDown () {driver.quit ();}}

JMeter Selenium Automation code for pressure measurement

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.