I have the following code :
import java.util.HashMap; import java.util.Map;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.openqa.selenium.support.ui.ExpectedConditions;
public class LoginToThePortal {
public static void main(String[] args) throws InterruptedException
{
System.setProperty("webdriver.chrome.driver","C:\\chromedriver\\chromedriver.exe");
WebDriver driver=new ChromeDriver();
driver.manage().window();
driver.get("");
Thread.sleep(2000);
WebElement username=driver.findElement(By.id("sfdc_username_container"));
Thread.sleep(5000);
WebElement password=driver.findElement(By.id("sfdc_password_container"));
WebElement login=driver.findElement(By.xpath("//*[@id=\"centerPanel\"]/div/div[2]/div/div[2]/div/div[3]/button/span"));
username.sendKeys("");
password.sendKeys("");
login.click();
}
}
And I have received the following error:
Exception in thread "main" org.openqa.selenium.ElementNotInteractableException: element not interactable.
And I don't understand how I have wrong. I will mention that I am at the begin. (I m still learning). Can someone have a look?