I have got Marathon JAVA Driver to work in Eclipse and it works fine when I run the code from eclipse. However, When I export the project as runnable JAR file, and then execute the JAR file, I get the below error and the application is not launched.
at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:61) Caused by: java.lang.NullPointerException at net.sourceforge.marathon.javadriver.JavaProfile.(JavaProfile.java:205)
import java.io.IOException;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import net.sourceforge.marathon.javadriver.JavaDriver;
import net.sourceforge.marathon.javadriver.JavaProfile;
import net.sourceforge.marathon.javadriver.JavaProfile.LaunchMode;
import net.sourceforge.marathon.javadriver.JavaProfile.LaunchType;
public class SwingAutomationSample {
public static JavaDriver driver;
public static JavaProfile profile;
@BeforeClass
public void setUp() throws IOException {
try {
profile = new JavaProfile(LaunchMode.EXECUTABLE_JAR);
profile.setLaunchType(LaunchType.FX_APPLICATION);
profile.setExecutableJar("C:/Users/KarthikRaja/Desktop/Projects/xxyy.jar");
profile.setWorkingDirectory("C:/Users/KarthikRaja/Desktop/Projects");
driver = new JavaDriver(profile);
}catch(Exception e) {
System.out.println("java driver error ------------ " + e.toString());
}
}
@Test
public void Form15CBFill() throws Exception {
System.out.println("Inside Test Class");
}
}```