# Targeting an element

**URL:** <https://forum.robotframework.org/t/targeting-an-element/1970>\
**Category:** Robot Framework\
**Created:** [22 June 2021 07:35 UTC](https://forum.robotframework.org/t/targeting-an-element/1970 "2021-06-22T07:35:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pema](https://avatars.discourse-cdn.com/v4/letter/p/6f9a4e/32.png) [@pema](https://forum.robotframework.org/u/pema)\
**Post date:** [22 June 2021 07:35 UTC](https://forum.robotframework.org/t/targeting-an-element/1970/1 "2021-06-22T07:35:27Z")

</div>

Hi all  
I am using appiumLibrary for robot framework for testing android app. but the issue is, the element I want to select does not have any of the following to target:  
text, resource-Id, content-desc, accessibilityId. it only have xPath which is quite long.  
how to target an element for this kind of scenarios.

---

<div class="post-metadata">

**Author:** ![Wolfe1](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/wolfe1/32/3386_2.png) [@Wolfe1](https://forum.robotframework.org/u/Wolfe1)\
**Post date:** [22 June 2021 13:58 UTC](https://forum.robotframework.org/t/targeting-an-element/1970/2 "2021-06-22T13:58:27Z")

</div>

I would take a look at some guides on building dynamic xpath. In most cases you can take that long xpath and cut it down using some of these methods:

> **[How To Write Dynamic XPath In Selenium WebDriver](https://www.softwaretestingmaterial.com/dynamic-xpath-in-selenium/)**
>
> In this post, we will see how to write dynamic xpath in selenium webdriver. There are different ways to handle xpath in selenium.

> **[XPath Functions For Dynamic XPath In Selenium](https://www.softwaretestinghelp.com/xpath-functions/)**
>
> This article explains how to use XPath Functions contains(), starts-with() and text() with attribute and text to uniquely identify the elements.
