0

I am trying to generate a jar file of my test to use it in JMeter, I am trying this solution How to make an executable jar file using IntelliJ from a Selenium/TestNG java file? but the problem in on step 4. 4- Select your main class using the browse button. When I search for class I can't select mine .java code, how I can do the step 4 possible?

My code

public class Jmeter {
    WebDriver driver = null;

    @Test
    public void testLoad() {
      //  Robot robot = new Robot();
        ChromeOptions options = new ChromeOptions();
        options.addArguments(Arrays.asList("disable-infobars", "ignore-certificate-errors", "start-maximized","use-fake-ui-for-media-stream"));//
        System.setProperty("webdriver.chrome.driver", "/usr/bin/chromedriver.exe");
        WebDriver driver = new ChromeDriver(options);
        driver.get("myurl");
        my commands
    }
}

Does someone know how to solve this?

Solution

I created a class with the main method to call my test.

package Jmeter;
public class JmeterMain {
    public static void main(String[] args) {
        Jmeter test = new Jmeter();

        test.testLoad();

    }
}
Thiago
  • 33
  • 3
  • 9
  • Hello @Thiago their has be at least one java class which contain the main method so if that present then also you can create jar files otherwise you don't – akshay patil Apr 16 '19 at 11:59
  • Thank you @akshaypatil, I created the main method to call my class test. – Thiago Apr 16 '19 at 13:35
  • if you find this comment is helpful to you then please click on Upside triangle button just above flag on my comment that will be great...^.^ Happy to help.. – akshay patil Apr 17 '19 at 04:35

0 Answers0