I need to open a link from a WinForm application in a Firefox browser. Then I can input the form (eg user name and Password) and would like to generate a button click (for example, a login button to submit the form).
I currently use IE Interop.SHDocVw.dll, but I need a Firefox implementation. Is there such a deal for Mozilla's Broser? Do I Need to Develop a Plugin? Or maybe I might have to use the UI test framework?
Thanks for the reply!
Bruno
So I start Firefox with the process: < / P>
process. Start ("firefox.exe", "http://www.mywebsite.com"); Then I use USER32.DLL to find and focus the Firefox window:
// Get handle in the application window. [DllImport ("USER32.DLL", Charset = Charset.unicode)] Public Static Extension Interpreting SearchWondo (string lpClassName, string lpWindowName); // Activate the application window [DllImport ("USER32.DLL")] Public static extern bool SetForegroundWindow (IntPtr hWnd); Private Zero btnEnterText_Click (Object Sender, EventArgs e) {var Handle = SearchWindow ("MozillaWindowclass", "Environmental Racket 1.4.0.3 - Mozilla Firefox"); SetForegroundWindow (handle); SendKeys.SendWait (txtEntry.Text); } I got the window class and title for the spy ++.
So my problem is not to go to the next input on the page, ... when I use it:
SendKeysq.Sedwight ("{TAB}" ); It transmits the focus as I pressed tab twice ... does anyone know what's going on?
Comments
Post a Comment