CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Threaded View

  1. #1
    Join Date
    Oct 2013

    Exclamation WPF with WatiN plug in. need to open up IE and go to google

    I am making a WPF application in visual studio 2012 for desktop. that Has to use the WatiN plug in. And I have to have a text box and button (which I have), That when you type in the text box and click the button the app will launch IE and go to google and search for whatever you typed into the text box and automatically select a link from the list of search results and go to that page. It opens up IE and goes to google and types in what was in the text box into the search box but than the app closes. It doesnt search or select a link at random. Here is the code I have so far please help.

    using WatiN.Core;
    namespace Search
        /// <summary>
        /// Interaction logic for MainWindow.xaml
        /// </summary>
        public partial class MainWindow : Window
            public MainWindow()
            private void Btn_Click(object sender, RoutedEventArgs e)
                using (var browser = new IE("http://www.google.com"))
                    System.Windows.Forms.SendKeys.SendWait("{ENTER}"); // presses search on the second screen
                    //browser.Button(Find.ById("gbqfb")/*.ByName("btnG")*/).Click();  // doesn't work
    Last edited by GremlinSA; November 7th, 2013 at 12:30 AM. Reason: added code tags.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.