1

I'm having a problem sending keys to a text field on an webpage written in angular JS.

Here is the WebElement in question:

<input name="CreateUserForename" id="Textc3829619-ad42-4df7-bbe3-5bdbe9fb9bce"
  ng-class="{'ng-pristine': controller.$pristine, 'ng-invalid': controller.$invalid,
  'ng-invalid-required': controller.$error.required, 'ng-valid': controller.$valid,
  'ng-dirty': controller.$dirty}" class="form-input ng-scope ng-valid ng-dirty" type="text"
  ng-if="!multiline" ng-hide="disabled" maxlength="">

Just using driver.find_element_by_xpath({xpath}).send_keys({keys}) gives this error:

Message: no such element: Unable to locate element: 
{"method":"xpath","selector":"//*[@id="Text9c04f240-66a6-478b-92c2-13bb39379b8e"]"}

Same when using the css_selector.

One workaround I've found is using ActionChains and move_to_element_with_offset, but that is not ideal.

Any ideas?

(please don't suggest the Protractor)

1 Answer 1

1

OK, it seems that driver.find_element_by_name("CreateUserForename") does the trick.

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

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.