1
votes

The site is running an older Angular version, 5.2.11.

I've got something that looks like a straight input field on the page, but maybe not so straight in the markup:

<div felt fieldname="approxCostDevelop" class="felt" e2e-selector="approx-cost-develop">
   <est-currecy-felt ng-model="develop.price" input-id="approxCostDevelop">
      <translate>Approximate cost of development</translate>
   </est-currency-felt>
</div>

When I try accessing this text field, selenium gives me and Element Not Interactable exception.

I've tried placing the e2e-selector attribute both where it is now, and after the input-id attribute field. I've also tried using the input-id attribut instead of the e2e-selector. Same result every time.

The way I create and access the WebElement:

//@FindBy(css = "[e2e-selector=approx-cost-develop]")
@FindBy(css = "[input-id=approxCostDevelop]")
private WebElement approxCostDevelopTextField;

public void setApproxCostDevelop(String approxCost) {
    pproxCostDevelopTextField.sendKeys(approxCost);
}

It's not a password field or any kind of special field. And it's visible all the time, from the loading of the page. The elements directly before it are a list of checkboxes, which all are interactable.

1
Have you tried adding a wait condition before sending keys? Something like wait.unti(ExpectedConditions.elementToBeClickable(approxCostDevelopTextField))?Mate Mrše
To find out about the angular version:stackoverflow.com/questions/44502779/….Mate Mrše
Mate Mrše: Yup. No change. The element is visible all the time, so it's not a visibility problem.Hfrav
The angular version is 5.2.11. Pretty old.Hfrav

1 Answers

2
votes

It looks like the element is embedded in the tag.

I'm not very familiar with Angular, but: Instead of using @FindBy and creating a named WebElement, try just creating a WebElement with the same name as the input-id. Like this:

private WebElement approxCostDevelop;