Hey Ranjan, you can use these lines of code to disable a popup or alert window in Firefox browser using Selenium. There is a preference called dom.disable_beforeunload. You should change its value to true. With Selenium, you can create a new customized Firefox profile:
import org.openqa.selenium.chrome.FirefoxDriver;
import org.openqa.selenium.chrome.Preferences;
FirefoxProfile customProfile = new FirefoxProfile();
customProfile.setPreference("dom.disable_beforeunload", true);
FirefoxDriver driver = new FirefoxDriver(customProfile);