-
Notifications
You must be signed in to change notification settings - Fork 4
WebDriver Examples
chrisabird edited this page Mar 9, 2012
·
3 revisions
The following is a trivial example of how the plasma WebDriver can be used to perform a simple test. The tests places a value in a text box form field, submits the form and expects the value entered to be displayed in an element on the page.
[TestFixture]
public class TextBoxTests
{
private PlasmaDriver driver;
[SetUp]
public void Setup()
{
driver = TestFixture.Driver;
driver.Navigate().GoToUrl("/FormWithTextBox/");
}
[Test]
public void ShouldBeAbleToSetValueOfATextBox()
{
const string value = "the value";
driver.FindElement(By.Name("textBox")).SendKeys(value);
driver.FindElement(By.TagName("form")).Submit();
Assert.That(driver.FindElement(By.Id("textBoxValue")).Text, Is.EqualTo(value));
}
}