# Get properties of a web page element

**URL:** <https://community.smartbear.com/t/get-properties-of-a-web-page-element/80>\
**Category:** Test Articles\
**Tags:** test, testcomplete, migrated, kb-article\
**Created:** [October 28, 2021, 12:29pm UTC](https://community.smartbear.com/t/get-properties-of-a-web-page-element/80 "2021-10-28T12:29:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [October 28, 2021, 12:29pm UTC](https://community.smartbear.com/t/get-properties-of-a-web-page-element/80/1 "2021-10-28T12:29:09Z")

</div>

> Originally published by **prekar** on October 28, 2021 in the previous SmartBear Community.

## Question

In this example, we will demonstrate how to get some more information about a web element by using TestComplete.

How to find the “Start a topic” button on the community page page and get the following info about it: color, font family, and font size and post the script and the log info below.

## Answer

```auto
//JavaScript
function test2()
{
var url = "https://community.smartbear.com/t5/TestComplete-General-Discussions/TechCorner-Challenge-13-Get-properties-of-a-web-page-element/m-p/207539";

Browsers.Item(btChrome).Run(url);
var page = Sys.Browser().Page(url);
var element = page.FindChildByXPath("//*[@class='NewTopic-link']");
var style = page.contentDocument.defaultView.getComputedStyle(element, "");
Log.Message("The Properties of web page element are as follows")
Log.Message("Background Color : " + style.backgroundColor);
Log.Message("Font Family : " + style.fontFamily);
Log.Message("Font Size : " + style.fontSize);
}

```
