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();
}
}