Equality is not defined for profiles. So we can only keep old or reset. Let's reset.
import static org.openqa.selenium.firefox.FirefoxDriver.BINARY;
import static org.openqa.selenium.firefox.FirefoxDriver.PROFILE;
-import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
@@ -139,9 +138,6 @@ public FirefoxOptions setProfile(FirefoxProfile profile) {
// Confusing API. Keeping package visible only
FirefoxOptions setProfileSafely(FirefoxProfile profile) {
- Preconditions.checkState(
- this.profile == null || this.profile.equals(profile),
- "Profile passed to options is different from existing profile that has been set.");
if (profile == null) {
return this;
}
