I am facing this problem since yesterday, Burp started showing the error below when trying to import the .jar file of the plugin, but Netbeans has no issues compiling it. I imported Selenium through the Maven dependency in the pom.xml file and each time I load the plugin into Burp i run the Clean and build option to avoid any issue
However, the code I run is like this:
void runBrowserAutomatization(File fileDriver, String seleniumTrack, boolean isHeadless) {
WebDriver driver;
if (gui.usedBrowser().toLowerCase().contains("chrome")) {
ChromeOptions options = new ChromeOptions();
Proxy proxy = new Proxy();
proxy.setHttpProxy("localhost:8080");
proxy.setSslProxy("localhost:8080");
options.setCapability(CapabilityType.PROXY, proxy);
options.setHeadless(isHeadless);
System.setProperty("webdriver.chrome.driver", fileDriver.getPath());
driver = new ChromeDriver(options);
} else if (gui.usedBrowser().toLowerCase().contains("firefox")) {
FirefoxOptions options = new FirefoxOptions();
Proxy proxy = new Proxy();
proxy.setHttpProxy("localhost:8080");
proxy.setSslProxy("localhost:8080");
options.setCapability(CapabilityType.PROXY, proxy);
options.setHeadless(isHeadless);
System.setProperty("webdriver.gecko.driver", fileDriver.getPath());
driver = new FirefoxDriver(options);
} else {
printMsg("No browser selected...");
return;
}
/// other stuff here
driver.close();
}
The error that is shown is the following
java.lang.ClassNotFoundException: org.openqa.selenium.WebDriver
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:436)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:416)
at burp.ehm.a(Unknown Source)
at burp.ehm.<init>(Unknown Source)
at burp.b6.a(Unknown Source)
at burp.c3u.lambda$panelLoaded$0(Unknown Source)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:830)
The awkward thing is that if I comment the two implementations of the driver object, Burp shows no error importing it. It seems like it has problem in implementing the WebDriver object, but not in declaring it, which is very strange for a ClassNotFoundException. Another tool, whose code has the same structure with these components, has no errors if it is loaded and runs fine.