From 6b4d3abf33a6f267e36c54c79238e49e7c1009d2 Mon Sep 17 00:00:00 2001 From: Steven Kirk Date: Tue, 30 Apr 2024 16:07:30 +0200 Subject: [PATCH] Added basic GetAttribute test. Currently failing and I'm not sure why. --- src/FlaUI.WebDriver.UITests/ElementTests.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/FlaUI.WebDriver.UITests/ElementTests.cs b/src/FlaUI.WebDriver.UITests/ElementTests.cs index 7088640..01a56a7 100644 --- a/src/FlaUI.WebDriver.UITests/ElementTests.cs +++ b/src/FlaUI.WebDriver.UITests/ElementTests.cs @@ -210,5 +210,17 @@ public void ActiveElement_Default_IsSupported() Assert.That(activeElement.Text, Is.EqualTo("Invoked!")); } + + [TestCase(["Name", "Label"])] + public void GetAttribute_Label_ReturnsValue(string attributeName, string expectedValue) + { + var driverOptions = FlaUIDriverOptions.TestApp(); + using var driver = new RemoteWebDriver(WebDriverFixture.WebDriverUrl, driverOptions); + var element = driver.FindElement(ExtendedBy.AccessibilityId("Label")); + + var value = element.GetAttribute(attributeName); + + Assert.That(value, Is.EqualTo(expectedValue)); + } } }