# Unable to find an element using parameter in attributes (worked in the past)

**URL:** <https://forum.katalon.com/t/unable-to-find-an-element-using-parameter-in-attributes-worked-in-the-past/103995>\
**Category:** Web Testing\
**Tags:** web-testing\
**Created:** [November 8, 2023, 3:23pm UTC](https://forum.katalon.com/t/unable-to-find-an-element-using-parameter-in-attributes-worked-in-the-past/103995 "2023-11-08T15:23:58Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![grylion54](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/grylion54/32/16265_2.png) [@grylion54](https://forum.katalon.com/u/grylion54)\
**Post date:** [November 8, 2023, 5:10pm UTC](https://forum.katalon.com/t/unable-to-find-an-element-using-parameter-in-attributes-worked-in-the-past/103995/3 "2023-11-08T17:10:46Z")

</div>

Here is another idea that creates a Test Object in code at run time. Instead of the bulky parameterization statement, this to me is much “simpler” to look at.

> [@Creation of Test Object in Object Repository in Runtime](http://forum.katalon.com/t/creation-of-test-object-in-object-repository-in-runtime/10333/17):
>
> A sample Test Case that creates a TestObject runtime import com.kms.katalon.core.model.FailureHandling import com.kms.katalon.core.testobject.ConditionType import com.kms.katalon.core.testobject.TestObject import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI def createTestObjectByXPath(id, xpath) { TestObject tObj = new TestObject(id) tObj.addProperty('xpath', ConditionType.EQUALS, xpath) return tObj } WebUI.openBrowser('') WebUI.navigateToUrl("http://demoaut.katalon.co…

Create a **Keyword** like @kazurayam or @Russ_Thomas have of the “makeTO” method and then pass the pathway (either CSS or XPath) to create a Test Object, like:

```auto
myAssistant = com.Tools.makeTO("//*[@name='minor-child2-dob' and @id='minor-child2-dob']")
WebUI.click(myAssistant)

```

Edit: Do NOT create two methods **exactly** alike to do CSS **and** XPath because you will get an error. You must have two different names; one to do CSS and another to do XPath, like “makeTO” which could do XPath and “createTO” which could do CSS (because the method starts with “C” ). 🙂

---

_[View the full topic](https://forum.katalon.com/t/unable-to-find-an-element-using-parameter-in-attributes-worked-in-the-past/103995)._
