I’ve a web page with AngularJS. The body-element captures all keyboard inputs with ng-keyup.
How can i simulate a user input?
I already tried type, XType, sendKeys,… Nothing works.
With XType it works to send control codes to the webpage like CTRL+S (opens the Save page dialog) but nothing else. All functions works only with input fields.
How can i send a text like “123456${KEY_ENTER}” to the page so that ng-keyup/ng-keypress gets the entered characters?
XType should work fine. So far it has worked with all websites that I used it on. => Do you have a link to a test page? Maybe some AngularJS demo page?
Edit: I have one idea what might be wrong: For XType, did you make sure that the right page element/input box has the focus? => It is best to have an XClick before Xtype:
XClick | locator of body element/input box
XType | 123456${KEY_ENTER}
On another computer the same script with the same macro works fine after i added the suggested XClick.
But it still doesn’t work on my developer computer (tested in Chrome and Firefox):
- open: Opens the URL
- XClick: Clicks the body
- XType: Nothing happens
On your developer computer, does DemoXClick and DmeoXType work?
Is this a Mac? Then see here: https://a9t9.com/kantu/x/download#mac-realuser
No it’s a Windows 10 computer.
After resetting the browsers (Chrome, Firefox and IE) to factory defaults it works now.