0

Hello I am working with watin and and trying to open url but I am getting follwoing exception:

at WatiN.Core.IE.CreateNewIEAndGoToUri(Uri uri, IDialogHandler logonDialogHan dler, Boolean createInNewProcess) at WatiN.Core.IE..ctor() at WatinTesting.Program.Main(String[] args) in c:\users\admin\documents\visua l studio 2010\Projects\WatinTesting\WatinTesting\Program.cs:line 20

The code earlier working fine. Please let me know what is going wrong : In case please let me know the alternative code that I can use for the same using type : Browser

The C# code is as follow:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WatiN.Core;
using WatiN.Core.Native.InternetExplorer;
using System.Threading;

namespace WatinTesting
{
    class Program
    {

        [STAThread]
        static void Main(string[] args)
        {
            try
            {               

                IE browser = new IE();
                    browser.GoTo("http://google.com");
                    browser.TextField(Find.ByName("q")).TypeText("WatiN");
                    browser.Button(Find.ByValue("Google Search")).Click();

            }
            catch (Exception e)
            {
                Console.WriteLine(e.StackTrace);
                Thread.Sleep(10000);
            }
        }
    }
}
0

1 Answer 1

0

Please add missing data like watin version and is the browser instance created (IE instance).

Maybe this will help try to create the IE instance with this parameters:

IE ie = new IE("http://www.google.com", true); //first param is url and the second is new process

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.