0

I'm using WatiN to fill in a form on a website. However, the text boxes' autocomplete feature only fire if I actually take the mouse and click on a text box. I've tried using Select(), Click() and TypeText() and in all of those cases, the autocomplete on the form doesn't fire.

Has anyone encountered this? Any way I can go around it? I assume that the autocomplete functionality gets triggered by JavaScript, but if I could just emulate a 'proper' mouse move and click, that would be enough for me.

Dmitri Nesteruk
  • 23,067
  • 22
  • 97
  • 166

1 Answers1

1

Moving the mouse is not Watin specific, you will need to use Windows API calls for that. But the autocomplete feature is a browser implementation, not a javascript one so that varies on each web browser. If you still want to clik on it using Windows API will do it. Be aware that moving the mouse is not as easy as it sounds as you have to account for were the page is EXACTLY at (it varies on different resolutions, if the page is in a small windows, etc., there are APIs to found the exact location too)

ProgrammerV5
  • 1,915
  • 2
  • 12
  • 22
  • What API do I use to find the location of a control on a web page? I assume WatiN has something for this. – Dmitri Nesteruk Jul 12 '16 at 18:19
  • Those are Windows API, not Watin. Things are getting "interesting" for you, if you have this up and running you can apply this "technique" for other controls as well (Flash movies, etc.) http://stackoverflow.com/questions/18034975/how-do-i-find-position-of-a-win32-control-window-relative-to-its-parent-window there is some work to be done but this definitely works and it is very reliable. – ProgrammerV5 Jul 12 '16 at 18:24