0

I am new to C# i want to develop a windows application to automate work.

Like i have a webform where user always goto that site he has to click the submit link. So i

want to do it automate. I am able to create a webrequest to the site by using

1st method

      HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
      request.Referer = "http://referer.com";
      request.UserAgent = "Mozilla/5.0";
      response = (HttpWebResponse)request.GetResponse();

2nd method

         Process proc = new Process();
         proc.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
         Process.Start("firefox.exe", "urlofform");
         Thread.Sleep(5000);
         SendKeys.SendWait("{TAB}");
         SendKeys.SendWait("{TAB}");            
         SendKeys.SendWait("~");
         Thread.Sleep(3000);

in the actual form i have a anchor tag like this

I want to click on the anchor automatically by using C# coding from windows application how can i achieve this?.....And which is the best way?

1 Answers1

0

You may look at some web testing frameworks such as WatiN: http://www.codeproject.com/Articles/17064/WatiN-Web-Application-Testing-In-NET

  • Thanks for quick response. The above link is working great for clicking a link but i want to pass the referrer as mentioned in the 1st method can i make it through this link? – user2045739 Feb 06 '13 at 07:12