Skip to content

Commit 30ab8b3

Browse files
committed
[dotnet] remove deprecated GetProperty()
1 parent b40ddeb commit 30ab8b3

File tree

4 files changed

+4
-50
lines changed

4 files changed

+4
-50
lines changed

dotnet/src/support/Events/EventFiringWebDriver.cs

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1563,30 +1563,7 @@ public string GetDomAttribute(string attributeName)
15631563
/// <summary>
15641564
/// Gets the value of a JavaScript property of this element.
15651565
/// </summary>
1566-
/// <param name="propertyName">The name JavaScript the JavaScript property to get the value of.</param>
1567-
/// <returns>The JavaScript property's current value. Returns a <see langword="null"/> if the
1568-
/// value is not set or the property does not exist.</returns>
1569-
[Obsolete("Use the GetDomProperty method instead.")]
1570-
public string GetProperty(string propertyName)
1571-
{
1572-
string elementProperty = string.Empty;
1573-
try
1574-
{
1575-
elementProperty = this.underlyingElement.GetProperty(propertyName);
1576-
}
1577-
catch (Exception ex)
1578-
{
1579-
this.parentDriver.OnException(new WebDriverExceptionEventArgs(this.parentDriver, ex));
1580-
throw;
1581-
}
1582-
1583-
return elementProperty;
1584-
}
1585-
1586-
/// <summary>
1587-
/// Gets the value of a JavaScript property of this element.
1588-
/// </summary>
1589-
/// <param name="propertyName">The name JavaScript the JavaScript property to get the value of.</param>
1566+
/// <param name="propertyName">The name of the JavaScript property to get the value of.</param>
15901567
/// <returns>The JavaScript property's current value. Returns a <see langword="null"/> if the
15911568
/// value is not set or the property does not exist.</returns>
15921569
public string GetDomProperty(string propertyName)

dotnet/src/webdriver/IWebElement.cs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -188,16 +188,6 @@ public interface IWebElement : ISearchContext
188188
/// </remarks>
189189
string GetDomAttribute(string attributeName);
190190

191-
/// <summary>
192-
/// Gets the value of a JavaScript property of this element.
193-
/// </summary>
194-
/// <param name="propertyName">The name JavaScript the JavaScript property to get the value of.</param>
195-
/// <returns>The JavaScript property's current value. Returns a <see langword="null"/> if the
196-
/// value is not set or the property does not exist.</returns>
197-
/// <exception cref="StaleElementReferenceException">Thrown when the target element is no longer valid in the document DOM.</exception>
198-
[Obsolete("Use the GetDomProperty method instead.")]
199-
string GetProperty(string propertyName);
200-
201191
/// <summary>
202192
/// Gets the value of a JavaScript property of this element.
203193
/// </summary>

dotnet/src/webdriver/WebElement.cs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -468,19 +468,6 @@ public virtual string GetDomAttribute(string attributeName)
468468
return attributeValue;
469469
}
470470

471-
/// <summary>
472-
/// Gets the value of a JavaScript property of this element.
473-
/// </summary>
474-
/// <param name="propertyName">The name of the JavaScript property to get the value of.</param>
475-
/// <returns>The JavaScript property's current value. Returns a <see langword="null"/> if the
476-
/// value is not set or the property does not exist.</returns>
477-
/// <exception cref="StaleElementReferenceException">Thrown when the target element is no longer valid in the document DOM.</exception>
478-
[Obsolete("Use the GetDomProperty method instead.")]
479-
public virtual string GetProperty(string propertyName)
480-
{
481-
return this.GetDomProperty(propertyName);
482-
}
483-
484471
/// <summary>
485472
/// Gets the value of a JavaScript property of this element.
486473
/// </summary>

dotnet/test/common/ElementPropertyTest.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public void ShouldReturnNullWhenGettingTheValueOfAPropertyThatIsNotListed()
1515
{
1616
driver.Url = simpleTestPage;
1717
IWebElement head = driver.FindElement(By.XPath("/html"));
18-
string attribute = head.GetProperty("cheese");
18+
string attribute = head.GetDomProperty("cheese");
1919
Assert.That(attribute, Is.Null);
2020
}
2121

@@ -25,9 +25,9 @@ public void CanRetrieveTheCurrentValueOfAProperty()
2525
{
2626
driver.Url = formsPage;
2727
IWebElement element = driver.FindElement(By.Id("working"));
28-
Assert.AreEqual(string.Empty, element.GetProperty("value"));
28+
Assert.AreEqual(string.Empty, element.GetDomProperty("value"));
2929
element.SendKeys("hello world");
30-
Assert.AreEqual("hello world", element.GetProperty("value"));
30+
Assert.AreEqual("hello world", element.GetDomProperty("value"));
3131
}
3232
}
3333
}

0 commit comments

Comments
 (0)