Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 24th, 2012  |  syntax: None  |  size: 0.67 KB  |  hits: 7  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. NUnit Selenium Structure
  2. [TestFixture]
  3. public class SomeTest
  4. {
  5.    IWebDriver driver;
  6.  
  7.    [Setup]
  8.    public void Setup()
  9.    {
  10.        driver = new InternetExplorerDriver();
  11.    }
  12.  
  13.    [Test]
  14.    public void Test1()
  15.    {
  16.    }
  17.  
  18.    [Test]
  19.    public void Test2()
  20.    {
  21.    }
  22.  
  23.    [Teardown]
  24.    public void Teardown()
  25.    {
  26.        driver.Close();
  27.    }
  28. }
  29.        
  30. [TestFixture]
  31. public class SomeTest
  32. {
  33.    IWebDriver driver;
  34.  
  35.    [TestFixtureSetup]
  36.    public void Setup()
  37.    {
  38.        driver = new InternetExplorerDriver();
  39.    }
  40.  
  41.    [Test]
  42.    public void Test1()
  43.    {
  44.    }
  45.  
  46.    [Test]
  47.    public void Test2()
  48.    {
  49.    }
  50.  
  51.    [TestFixtureTeardown]
  52.    public void Teardown()
  53.   {
  54.        driver.Close();
  55.    }
  56. }