自動テストツール③ Selenium2 5/5

ブラウザ

Firefox

using OpenQA.Selenium.Firefox;
IWebDriver driver = new FirefoxDriver();
driver.Url = “http://google.com”;

InternetExplorer

using OpenQA.Selenium.IE;

//IE用WebDriver(実行ファイル:IEDriverServer.exe)をダウンロード&パス指定
IWebDriver driver = new InternetExplorerDriver(@”保存パス”);
例:「D:\MyProject\Library」に保存した場合(↓フォルダまで)
IWebDriver driver = new InternetExplorerDriver(@”D:\MyProject\Library\”);
driver.Navigate().GoToUrl(@”http://google.com”);

Firefox

Imports OpenQA.Selenium.Firefox
Dim driver As IWebDriver = New FirefoxDriver
driver.Url = “http://google.com”

Internet

Imports OpenQA.Selenium.IE
Dim driver As IWebDriver = new InternetExplorerDriver(“保存パス”)
例:「D:\MyProject\Library」に保存した場合(↓フォルダまで)
Dim driver As IWebDriver = new InternetExplorerDriver(“D:\MyProject\Library\”)
driver.Url = “http://google.com”