# How to handle changing frame name with xpath

**URL:** <https://forum.katalon.com/t/how-to-handle-changing-frame-name-with-xpath/55191>\
**Category:** Web Testing\
**Tags:** katalon-studio\
**Created:** [May 27, 2021, 8:34am UTC](https://forum.katalon.com/t/how-to-handle-changing-frame-name-with-xpath/55191 "2021-05-27T08:34:35Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [May 27, 2021, 9:31am UTC](https://forum.katalon.com/t/how-to-handle-changing-frame-name-with-xpath/55191/2 "2021-05-27T09:31:25Z")

</div>

> [@cyril.perie96](#):
>
> //frame[ends-with(@name,’\_right’)]

`ends-with` function is defined in the W3C XPath 2.0 specification, but no browser support it. You can not use `ends-with` in Selenium tests.

But you can write an equivalent XPath expression using `substring` and `string-length` function of XPath1.0. Both functins are supported by any browser. See the following post for example:

> [@Unable to find the element located by 'By.xpath;](http://forum.katalon.com/t/unable-to-find-the-element-located-by-by-xpath/52826/7):
>
> You have this: //iframe[ends-with(@id,'iframe')] Unfortunately no browser supports the XPath 2.0 function ends-with(). It would never work. You can write an alternative expression using XPath 1.0 functions substring and string-length: //iframe[substring(@id, string-length(@id) - string-length('iframe') +1) = 'iframe']

---

_[View the full topic](https://forum.katalon.com/t/how-to-handle-changing-frame-name-with-xpath/55191)._
