System.setProperty(FirefoxDriver.SystemProperty.BROWSER_LOGFILE, "null");
FirefoxOptions options=new FirefoxOptions();
ProfilesIni profile = new ProfilesIni();
FirefoxProfile myprofile = profile.getProfile("***");
myprofile.setPreference("dom.webnotifications.enabled", false);
options.setProfile(myprofile);
WebDriver driver=new FirefoxDriver();
driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);
driver.manage().timeouts().setScriptTimeout(20, TimeUnit.SECONDS);
driver.manage().window().maximize();
driver.get("https://facebook.com");
driver.findElement(By.id("email")).sendKeys("*****");
driver.findElement(By.id("pass")).sendKeys("******");
driver.findElement(By.id("pass")).sendKeys(Keys.ENTER);
driver.findElement(By.xpath("//div[text()='*******']")).click();
WebElement profilePic = driver.findElement(By.xpath("//div[@class='fbTimelineProfilePicSelector _23fv']/div/a"));
Thread.sleep(5000);
Actions act=new Actions(driver);
act.moveToElement(profilePic).build().perform();
driver.findElement(By.xpath("//div[@class='fbTimelineProfilePicSelector _23fv']/div/a")).click();
driver.findElement(By.xpath("//span[text()='Upload Photo']")).click();
Thread.sleep(5000);
new ProcessBuilder("F:\\fb.exe").start();
getting Elementnotclickable exception for upload click line,and still getting webNotifications even after disabling notifications,please help
thank you
Instructor
Ashish Thakur Replied on 12/12/2019
Try this