Seleniumを使用して作成されたテストメソッドがあります。これは次のようなものです。
[TestFixture]
public class Test_Google
{
IWebDriver driver;
[SetUp]
public void Setup()
{
driver = new InternetExplorerDriver();
}
[TearDown]
public void Teardown()
{
driver.Quit();
}
[Test]
public void TestSearchGoogleForTheAutomatedTester()
{
//Navigate to the site
driver.Navigate().GoToUrl("http://www.google.co.uk");
//Find the Element and create an object so we can use it
IWebElement queryBox = driver.FindElement(By.Name("q"));
//Work with the Element that's on the page
queryBox.SendKeys("The Automated Tester");
queryBox.SendKeys(Keys.ArrowDown);
queryBox.Submit();
//Check that the Title is what we are expecting
Assert.True(driver.Title.IndexOf("The Automated Tester") > -1);
}
}
テストが実行されると、IEが開き、テストが実行されます。
このような200のテスト方法が複数のテストフィクスチャに分散していると想像してください。つまり、IEは何度も開閉する必要があります(テストフィクスチャごとに1つのブラウザが開かれるため、テストフィクスチャと同じ数)。
ブラウザを開かずにSeleniumシステムテストを実行するにはどうすればよいですか?
たとえば、WinForms WebブラウザコントロールでSeleniumテストを実行するWindowsサービスを開発できる可能性があると考えていました。その場合、ブラウザを毎回開く必要はなく、テストは自動的に無意識に実行できます。 。しかし、これを実装する方法がわかりませんか?
または、他によく知られている方法はありますか?
ありがとう、