I am using the  MbUnit.Samples.WebTestingWithWatiN Samples coming with
Version 3.2.0 of Gallio/MbUnit as a starter.
The new Page-base syntax is very useful and gives a much more
transparent design of Test Units.

To simulate a larger web page with complex login, I tried to port a
test that opens the browser once in the FixtureSetup, and performs
several test without closing the browser. The example is shown below
(paste it as a new class into the sample demo), but it fails with an
error message in Fixture setup.

"There is no current browser context.  Does the test have a [Browser]
attribute?"

It works with the commented out individual GoTo(browser), but that's
not what I want.

How do I handle this case correctly? I know how to do it the classical
way in WatiN, but is this possible the new way?

Dieter


using System.Diagnostics;
using MbUnit.Framework;
using MbUnit.Samples.WebTestingWithWatiN.Framework;

namespace MbUnit.Samples.WebTestingWithWatiN
{
  internal class MultipleGoogleSearchDemo : BrowserTestFixture
  {
    [Browser(BrowserType.IE)]
    [FixtureSetUp]
    public void FixtureSetup()
    {
      GoogleSearchPage.GoTo(Browser);
    }

    //    [FixtureTearDown]

    [Test]
    [Browser(BrowserType.IE)]
    public void SuccessfulFiddleSearch()
    {
//      GoogleSearchPage.GoTo(Browser);
      Browser.Page<GoogleSearchPage>().Search("Fiddlesticks");
      Assert.Contains(Browser.Text, "Fiddlesticks");
    }

    [Test]
    [Browser(BrowserType.IE)]
    public void SuccessfulWatinSearch()
    {
//      GoogleSearchPage.GoTo(Browser);
      Browser.Page<GoogleSearchPage>().Search("WatiN");
      Assert.Contains(Browser.Text, "WatiN");
    }
  }

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"MbUnit.User" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/mbunituser?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to