# Testing that an element has a css class

**URL:** <https://forum.katalon.com/t/testing-that-an-element-has-a-css-class/10568>\
**Category:** Miscellaneous\
**Created:** [April 27, 2018, 1:16pm UTC](https://forum.katalon.com/t/testing-that-an-element-has-a-css-class/10568 "2018-04-27T13:16:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![scott\_williams](https://avatars.discourse-cdn.com/v4/letter/s/eb8c5e/32.png) [@scott\_williams](https://forum.katalon.com/u/scott_williams)\
**Post date:** [April 27, 2018, 1:16pm UTC](https://forum.katalon.com/t/testing-that-an-element-has-a-css-class/10568/1 "2018-04-27T13:16:02Z")

</div>

I have a situation where I am going through and filling out a form. When I go back in to view the form the selected items have a different class than before. Is there a way to check that these items have this class without going in and creating new test objects for these elements?

---

<div class="post-metadata">

**Author:** ![Rahul](https://avatars.discourse-cdn.com/v4/letter/r/f14d63/32.png) [@Rahul](https://forum.katalon.com/u/Rahul)\
**Post date:** [May 3, 2018, 5:24pm UTC](https://forum.katalon.com/t/testing-that-an-element-has-a-css-class/10568/2 "2018-05-03T17:24:22Z")

</div>

You can use the GetAttribute method

WebUI.getAttribute(findTestObject(‘W3School/TryItButtonFrame’), “class”)
