I am facing this issue when i want to set Firefox preferences as follows :
public class MyTest{
public WebDriver driver;
public String baseUrl;
@BeforeSuite
public void beforeSuite() {
driver = new FirefoxDriver();
FirefoxOptions options = new FirefoxOptions();
//FirefoxProfile profile = new FirefoxProfile();
options.addPreference("browser.download.folderList", 1);
options.addPreference("browser.download.dir", "C:\\Downloads");
options.addPreference("browser.download.useDownloadDir", true);
options.addPreference("browser.download.viewableInternally.enabledTypes", "");
options.addPreference("browser.helperApps.neverAsk.saveToDisk", "application/pdf;text/plain;application/text;text/xml;application/xml");
options.addPreference("pdfjs.disabled", true);
WebDriver driver = FirefoxDriver(options);
//some other code
And the issue is for FirefoxDriver(options) . It underlines The method FirefoxDriver(FirefoxOptions) is undefined for the type MyTest
Anyone can give a support on that ?