1

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.

4
  • Have you tried adding a wait condition before sending keys? Something like wait.unti(ExpectedConditions.elementToBeClickable(approxCostDevelopTextField))? Commented Jun 11, 2019 at 9:57
  • To find out about the angular version:stackoverflow.com/questions/44502779/…. Commented Jun 11, 2019 at 10:00
  • Mate Mrše: Yup. No change. The element is visible all the time, so it's not a visibility problem. Commented Jun 11, 2019 at 10:21
  • The angular version is 5.2.11. Pretty old. Commented Jun 11, 2019 at 10:25

1 Answer 1

1

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;
Sign up to request clarification or add additional context in comments.

1 Comment

@FrankH. That was stunning +1. Any explanation/documentation?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.