1 using System; 2 using System.Collections.Generic; 3 using NUnit.Framework; 4 using System.Collections.ObjectModel; 5 using OpenQA.Selenium.Environment; 6 7 namespace OpenQA.Selenium 8 { 9 [TestFixture] 10 public class ElementPropertyTest : DriverTestFixture 11 { 12 [Test] 13 [IgnoreBrowser(Browser.Remote)] 14 public void ShouldReturnNullWhenGettingTheValueOfAPropertyThatIsNotListed() 15 { 16 driver.Url = simpleTestPage; 17 IWebElement head = driver.FindElement(By.XPath("/html")); 18 string attribute = head.GetDomProperty("cheese"); 19 Assert.That(attribute, Is.Null); 20 } 21 22 [Test] 23 [IgnoreBrowser(Browser.Remote)] 24 public void CanRetrieveTheCurrentValueOfAProperty() 25 { 26 driver.Url = formsPage; 27 IWebElement element = driver.FindElement(By.Id("working")); 28 Assert.AreEqual(string.Empty, element.GetDomProperty("value")); 29 element.SendKeys("hello world"); 30 Assert.AreEqual("hello world", element.GetDomProperty("value")); 31 } 32 } 33 }