7

Visual Studioを使用してC#で記述し、Selenium WebDriverコードを作成し、それをNUnitに渡してテストを実行しています。

コードを最初にビルドしてデバッグしたとき、コードはNUnitに渡され、そこから正常に実行できました(正しいブラウザーをロードして正しいWebページをロードする)

最近まで、NUnitで実行しようとすると、実行エラーが発生します。

FirstSeleniumTest.SeleniumTest.TestGoogle:
SetUp : OpenQA.Selenium.WebDriverException : You will need to use add InternetExplorerDriver.UseLegacyInternalServer to the desired capabilities to use the internal native code server library. This functionality will be deprecated in favor of the standalone IEDriverServer.exe server.
  ----> OpenQA.Selenium.DriverServiceNotFoundException : The file C:\Users\lbrown\Documents\Visual Studio 2010\Projects\ClassLibrary15\ClassLibrary15\bin\Debug\IEDriverServer.exe does not exist. The driver can be downloaded at http://code.google.com/p/selenium/downloads/list
TearDown : System.NullReferenceException : Object reference not set to an instance of an object.

表示されたドライバーをダウンロードしましたが、次に何をするか、コードのどこに配置するかがわかりません。

4

1 に答える 1

3

ドライバーを解凍し、テストの実行元と同じフォルダーに配置します。Visual Studioのプロジェクトに追加し、ビルドプロパティが[常にコピー]に設定されていることを確認します。これにより、テストを含むコンパイル済みの.DLLファイルと同じビルドディレクトリに常にコピーされます。

後で移動できますが、テストと同じフォルダーにある場合は機能します。

于 2012-06-15T22:33:29.393 に答える