Note that there are some explanatory texts on larger screens.

plurals
  1. POTwo Test Methods are not working simultaneously in Watin, Gallio and MbUnit
    text
    copied!<p>When I am writing this piece of code it works fine</p> <pre><code>using System; using WatiN.Core; using MbUnit.Framework; using Gallio.Framework; using System.Text.RegularExpressions; using System.Collections; using System.IO; using System.Drawing; using Gallio.Model; namespace DialogHandlerTestWithWatin { [TestFixture] class Program { //This is WatiN - create IE instance public static IE ie = new IE(); [SetUp] public void DoTestSetup() { IE.Settings.WaitForCompleteTimeOut = 60; } [TearDown] public static void TestNavigateToMedappz() { if (ie != null) { if (TestContext.CurrentContext.Outcome == TestOutcome.Failed) { Assert.Fail("Unable to navigate to the medappz application"); ie.Close(); ie.Dispose(); ie = null; } } } //This funcn navigate us to the Medappz Application [Test] public static void NavigateToMedappz() { using (TestLog.BeginSection("Go to Medappz")) { Assert.IsNotNull(ie); ie.GoTo("http://192.168.10.82/Sage/"); ie.ShowWindow(NativeMethods.WindowShowStyle.Maximize); } //This is NUnit - check that ie instance is not null Assert.IsNotNull(ie, "Error creating IE instance."); Assert.AreEqual("Login Page", ie.Title); } </code></pre> <p>But when I add another test method in this code as </p> <pre><code> [TearDown] public static void TestLoginToMedappz() { if (ie != null) { if (TestContext.CurrentContext.Outcome == TestOutcome.Failed) { Assert.Fail("Unable to Login"); } } } [Test] public static void LoginToMedappz() { using (TestLog.BeginSection("Login to Medappz")) { TextField UserName = ie.TextField(Find.ByName("txtUserName")); UserName.TypeText("&lt;username&gt;"); TextField Password = ie.TextField(Find.ByName("txtPassword")); Assert.IsTrue(UserName.Exists, "UserName Textbox does not exist"); Assert.IsTrue(Password.Exists, "Password Textbox does not exist"); Password.TypeText("&lt;password&gt;"); Button btnLogin = ie.Button(Find.ByName("btnLogin")); Assert.IsTrue(btnLogin.Exists, "btnLogin button does not exist"); btnLogin.Blur(); btnLogin.Click(); } } </code></pre> <p>Then the test started failing, only a blank IE window opens up and after few seconds the first test method is executed but the second method doesn't gets executed.The Gallio test report says </p> <p>Root 110 Results: 2 run, 1 passed, 1 failed, 0 inconclusive, 0 skipped Duration: 44.042s Assertions: 3 WatiN.Core.Exceptions.ElementNotFoundException: Could not find INPUT (text password textarea hidden) or TEXTAREA element tag matching criteria: Attribute 'name' with value 'txtUserName'</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload