1

Need: Update fields on url & click button using Selenium (Screenshot of Webpage & HTML details below)

Issue: Returns an error as shown below

Error:

Exception in thread "main" org.openqa.selenium.ElementNotInteractableException: 
element not interactable

(Session info: chrome=78.0.3904.70)

Research: I referred to the following but was unable to fix it - Link1 Link2

Code: Based on the suggestions in other links have added Wait & also sleep, but still not working.

WebDriver driver = new ChromeDriver();
driver.get(url);
WebElement email = driver.findElement(By.xpath("//label[contains(text(),'User ID')]"));
WebElement password = driver.findElement(By.xpath("//label[contains(text(),'Password')]"));
new WebDriverWait(driver,20);
            try {
                Thread.sleep(10000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
email.sendKeys("[email protected]");

HTML & WebPage View: Link

Hope the issue faced is clear, await guidance.

2
  • are you sure //label[contains(text(),'User ID')] element is present on UI after launching your url? Commented Oct 30, 2019 at 6:39
  • @DebanjanB no it does not. Before marking my query as duplicate if you had seen the error message you would've known. I had checked that link before posting. Anyway the answer by Ayaz (first option) resolves this issue. Commented Oct 30, 2019 at 11:00

1 Answer 1

2

Please try any of following xpath

//label[contains(text(),'User ID')]/following-sibling::input

//input[@placeholder='User ID']

your xpath is targeting label. You need to locate <input>

Sign up to request clarification or add additional context in comments.

1 Comment

Not sure why moderator has marked it as duplicate. Anyone facing this issue use the first option suggested by Ayaz (i.e. /following-sibling), that works, not the 2nd one.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.