blob: 5e535ce57ecb6d5a83dce43350d02d86a03da36c [file] [log] [blame]
using System;
using System.Collections.Generic;
using System.Text;
using NUnit.Framework;
using System.Threading;
namespace Selenium.Tests
{
[TestFixture]
public class TestElementPresent : SeleniumTestCaseBase
{
[Test]
public void ShouldDetectElementPresent()
{
selenium.Open("../tests/html/test_element_present.html");
Assert.IsTrue(selenium.IsElementPresent("aLink"));
selenium.Click("removeLinkAfterAWhile");
for (int second = 0; ; second++)
{
if (second >= 60) Assert.Fail("timeout");
try { if (!selenium.IsElementPresent("aLink")) break; }
catch (Exception) { }
Thread.Sleep(1000);
}
Assert.IsFalse(selenium.IsElementPresent("aLink"));
selenium.Click("addLinkAfterAWhile");
for (int second = 0; ; second++)
{
if (second >= 60) Assert.Fail("timeout");
try { if (selenium.IsElementPresent("aLink")) break; }
catch (Exception) { }
Thread.Sleep(1000);
}
Assert.IsTrue(selenium.IsElementPresent("aLink"));
}
}
}