Skip to content

Commit 6fc9b70

Browse files
committed
class
1 parent 7328f50 commit 6fc9b70

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

dotnet/test/common/ElementAttributeTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ public void ShouldReturnValueOfClassAttributeOfAnElement()
212212
driver.Url = xhtmlTestPage;
213213

214214
IWebElement heading = driver.FindElement(By.XPath("//h1"));
215-
String className = heading.GetAttribute("class");
215+
String className = heading.GetDomAttribute("class");
216216

217217
Assert.That(className, Is.EqualTo("header"));
218218
}
@@ -439,7 +439,7 @@ public void ShouldReturnValueOfClassAttributeOfAnElementAfterSwitchingIFrame()
439439
driver.SwitchTo().Frame("iframe1");
440440

441441
IWebElement wallace = driver.FindElement(By.XPath("//div[@id='wallace']"));
442-
String className = wallace.GetAttribute("class");
442+
String className = wallace.GetDomAttribute("class");
443443
Assert.That(className, Is.EqualTo("gromit"));
444444
}
445445
}

dotnet/test/common/ElementFindingTest.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ public void FindingASingleElementByAWeirdLookingClassName()
360360
driver.Url = xhtmlTestPage;
361361
String weird = "cls-!@#$%^&*";
362362
IWebElement element = driver.FindElement(By.ClassName(weird));
363-
Assert.That(element.GetAttribute("class"), Is.EqualTo(weird));
363+
Assert.That(element.GetDomAttribute("class"), Is.EqualTo(weird));
364364
}
365365

366366
[Test]
@@ -370,7 +370,7 @@ public void FindingMultipleElementsByAWeirdLookingClassName()
370370
String weird = "cls-!@#$%^&*";
371371
ReadOnlyCollection<IWebElement> elements = driver.FindElements(By.ClassName(weird));
372372
Assert.That(elements, Has.Count.EqualTo(1));
373-
Assert.That(elements[0].GetAttribute("class"), Is.EqualTo(weird));
373+
Assert.That(elements[0].GetDomAttribute("class"), Is.EqualTo(weird));
374374
}
375375

376376
// By.XPath positive
@@ -559,7 +559,7 @@ public void ShouldBeAbleToFindASingleElementByCssSelector()
559559
driver.Url = xhtmlTestPage;
560560
IWebElement element = driver.FindElement(By.CssSelector("div.content"));
561561
Assert.That(element.TagName.ToLower(), Is.EqualTo("div"));
562-
Assert.That(element.GetAttribute("class"), Is.EqualTo("content"));
562+
Assert.That(element.GetDomAttribute("class"), Is.EqualTo("content"));
563563
}
564564

565565
[Test]
@@ -576,7 +576,7 @@ public void ShouldBeAbleToFindASingleElementByCompoundCssSelector()
576576
driver.Url = xhtmlTestPage;
577577
IWebElement element = driver.FindElement(By.CssSelector("div.extraDiv, div.content"));
578578
Assert.That(element.TagName.ToLower(), Is.EqualTo("div"));
579-
Assert.That(element.GetAttribute("class"), Is.EqualTo("content"));
579+
Assert.That(element.GetDomAttribute("class"), Is.EqualTo("content"));
580580
}
581581

582582
[Test]
@@ -585,8 +585,8 @@ public void ShouldBeAbleToFindMultipleElementsByCompoundCssSelector()
585585
driver.Url = xhtmlTestPage;
586586
ReadOnlyCollection<IWebElement> elements = driver.FindElements(By.CssSelector("div.extraDiv, div.content"));
587587
Assert.That(elements, Has.Count.GreaterThan(1));
588-
Assert.That(elements[0].GetAttribute("class"), Is.EqualTo("content"));
589-
Assert.That(elements[1].GetAttribute("class"), Is.EqualTo("extraDiv"));
588+
Assert.That(elements[0].GetDomAttribute("class"), Is.EqualTo("content"));
589+
Assert.That(elements[1].GetDomAttribute("class"), Is.EqualTo("extraDiv"));
590590
}
591591

592592
[Test]

dotnet/test/common/StaleElementReferenceTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public void ShouldNotCrashWhenQueryingTheAttributeOfAStaleElement()
4949
driver.Url = xhtmlTestPage;
5050
IWebElement heading = driver.FindElement(By.XPath("//h1"));
5151
driver.Url = simpleTestPage;
52-
Assert.That(() => { string className = heading.GetAttribute("class"); }, Throws.InstanceOf<StaleElementReferenceException>());
52+
Assert.That(() => { string className = heading.GetDomAttribute("class"); }, Throws.InstanceOf<StaleElementReferenceException>());
5353
}
5454

5555
[Test]

0 commit comments

Comments
 (0)