0

こんにちは、私は watin を使用しており、URL を開こうとしていますが、次の例外が発生しています。

WatiN.Core.IE.CreateNewIEAndGoToUri(Uri uri, IDialogHandler logonDialogHandler, Boolean createInNewProcess) で WatiN.Core.IE..ctor() で WatinTesting.Program.Main(String[] args) で c:\users\admin\ documents\visual studio 2010\Projects\WatinTesting\WatinTesting\Program.cs: 20 行目

以前のコードは正常に動作しました。何が問題なのか教えてください: 場合に備えて、同じタイプで使用できる代替コードを教えてください: ブラウザ

C# コードは次のとおりです。

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);
            }
        }
    }
}
4

1 に答える 1

0

watin バージョンなどの不足しているデータを追加してください。これは、作成されたブラウザ インスタンス (IE インスタンス) です。

おそらく、これは、次のパラメーターを使用して IE インスタンスを作成しようとするのに役立ちます。

IE ie = new IE("http://www.google.com", true); //first param is url and the second is new process
于 2013-02-19T19:44:17.100 に答える