0
votes
selenium code is:
package junitJmeter;

import static org.junit.Assert.*;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

public class LoadTests {
    WebDriver driver;

    @Before
    public void SetUp() {
        driver = new FirefoxDriver();
    }

    @Test
    public void testCase01LoadingFirstPage() throws Exception {
        driver.get("https://www.google.com");
        assertEquals("Google", driver.getTitle());
    }

    @After
    public void tearDown() {
        driver.quit();
    }
   }

and I have exported as jar file, put it into jmeter lib/junit folder. in jmeter i have created -threadGroup -junitRequest -viewRrsultTree but the test not run at all, even cannot open firefox

1
and I have put selenium-server-standalone-2.45.0.jar and selenium-java-2.45.0.jar into jmeter /lib folderYu Jia

1 Answers

0
votes

Probably it's due to typo, Java method names should start with lowercase letter so change

public void SetUp() {

to

public void setUp() {

and it should do the trick for you.

By the way, there is a WebDriver Sampler available via JMeter Plugins, perhaps it could make your life easier.