Uploaded my entire webpage on which my test is failing here: https://drive.google.com/file/d/1WHcwpQFi5Cxh1q1MupQEuSPk6CPZs2GC/view?usp=sharing
Below is my Selenium Java
Instead of invoking sendKeys() to the you need to invoke on the
element and ideally to click() on the element you need to use WebDriverWait for the
elementToBeClickable()
and you can use either of the following Locator Strategies:
cssSelector
:
WebElement element = new WebDriverWait(driver, 20).until(ExpectedConditions.elementToBeClickable(By.cssSelector("div.row div.field-crtestrequest-cr_app_name>label[for='crtestrequest-cr_app_name']")));
element.click();
element.clear();
element.sendKeys("Allocation");
xpath
:
WebElement element = new WebDriverWait(driver, 20).until(ExpectedConditions.elementToBeClickable(By.xpath("//div[@class='row']//div[contains(@class, 'field-crtestrequest-cr_app_name')]/label[@for='crtestrequest-cr_app_name']")));
element.click();
element.clear();
element.sendKeys("Allocation");
You can find a couple of relevant discussions on ElementNotInteractableException in: