Element not clickable Exception in module 17 | Selenium Forum
R
ramu.gande Posted on 12/12/2019


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


A
Ashish Thakur Replied on 12/12/2019

Try this

 

WebDriver driver=null ;
FirefoxProfile profile = new FirefoxProfile();
profile.setPreference(“permissions.default.desktop-notification”, 1);
DesiredCapabilities capabilities=DesiredCapabilities.firefox();
capabilities.setCapability(FirefoxDriver.PROFILE, profile);
driver = new FirefoxDriver(capabilities);
driver.get(“your Web site”);