Home > OS >  How to fix a Deprecation Warning, Firefox ProfilesIni has been deprecated in java
How to fix a Deprecation Warning, Firefox ProfilesIni has been deprecated in java

Time:01-20

I want to use my custom Firefox profile and I'm getting a Deprecation Warning on

ProfilesIni myProfile = new ProfilesIni();

@SuppressWarnings. How do I fix this issue.

import org.openqa.selenium.WebDriver; 
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.internal.ProfilesIni;
import org.openqa.selenium.firefox.FirefoxProfile;

//System.setProperty("C:\\driver\\geckodriver.exe");

ProfilesIni myProfile = new ProfilesIni();

FirefoxProfile test = myProfile.getProfile("selenium 1");

WebDriver driver = new FirefoxDriver(test);

driver.manage().window().maximize();

driver.get("https://www.google.com");

CodePudding user response:

Just use the newer class as mentioned in the on class

on method

  •  Tags:  
  • Related