Complete the code to create a new Firefox profile.
FirefoxProfile profile = new FirefoxProfile(new File([1]));The FirefoxProfile constructor accepts a File object pointing to the profile directory. Here, the path string is passed inside new File() implicitly by the constructor.
Complete the code to set the Firefox profile in FirefoxOptions.
FirefoxOptions options = new FirefoxOptions();
options.setProfile([1]);You must pass the existing profile object to setProfile() to apply it to the options.
Fix the error in the code to launch Firefox with a custom profile.
WebDriver driver = new FirefoxDriver([1]);The FirefoxDriver constructor expects a FirefoxOptions object, not a profile directly.
Fill both blanks to create a FirefoxOptions object with a profile and launch the driver.
FirefoxOptions options = new FirefoxOptions(); options.[1]([2]); WebDriver driver = new FirefoxDriver(options);
setOptions is invalid.Use setProfile method to assign the existing profile to the options.
Fill all three blanks to create a ChromeOptions object with a user profile directory and launch ChromeDriver.
ChromeOptions options = new ChromeOptions(); options.addArguments([1] + [2], [3]); WebDriver driver = new ChromeDriver(options);
--disable-extensions is unrelated to profile management.To use a Chrome user profile, add the argument --user-data-dir= with the profile path, and specify the profile directory with --profile-directory=Default.