# Xpath not working in Katalon but works in Chrome Dev Tools

**URL:** <https://forum.katalon.com/t/xpath-not-working-in-katalon-but-works-in-chrome-dev-tools/36185>\
**Category:** Web Testing\
**Tags:** katalon-studio\
**Created:** [November 12, 2019, 9:43pm UTC](https://forum.katalon.com/t/xpath-not-working-in-katalon-but-works-in-chrome-dev-tools/36185 "2019-11-12T21:43:20Z")\
**Posts on this page:** 4\
**Page:** 2

<div class="post-metadata">

**Author:** ![sarah.kladstrup](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/sarah.kladstrup/32/9513_2.png) [@sarah.kladstrup](https://forum.katalon.com/u/sarah.kladstrup)\
**Post date:** [November 15, 2019, 6:50pm UTC](https://forum.katalon.com/t/xpath-not-working-in-katalon-but-works-in-chrome-dev-tools/36185/21 "2019-11-15T18:50:58Z")

</div>

@Brandon_Hein You were on to something with the iFrames. I removed the `and ref_element = 'myiFramePathHere'` and it’s working much better.

Here’s the xpath that does work:  
`//img[contains(@src, 'SR-SE.png')]/parent::div/parent::div/parent::li/preceding-sibling::li/descendant::div[text()='None']`

Contrast with the first xpath, with the iframe reference removed:  
`//img[contains(@src, 'SR-SE.png')]/parent::div/parent::div/parent::li/preceding-sibling::li/descendant::div[text()='None']`

and they are identical.

I have lost hair over this.

---

<div class="post-metadata">

**Author:** ![Brandon\_Hein](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/brandon_hein/32/1092_2.png) [@Brandon\_Hein](https://forum.katalon.com/u/Brandon_Hein)\
**Post date:** [November 15, 2019, 6:54pm UTC](https://forum.katalon.com/t/xpath-not-working-in-katalon-but-works-in-chrome-dev-tools/36185/22 "2019-11-15T18:54:37Z")

</div>

So is it working as expected now (can we close the topic?). Or are you still having other issues?

---

<div class="post-metadata">

**Author:** ![sarah.kladstrup](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/sarah.kladstrup/32/9513_2.png) [@sarah.kladstrup](https://forum.katalon.com/u/sarah.kladstrup)\
**Post date:** [November 15, 2019, 7:07pm UTC](https://forum.katalon.com/t/xpath-not-working-in-katalon-but-works-in-chrome-dev-tools/36185/23 "2019-11-15T19:07:58Z")

</div>

Yes, we can close this topic. Thank you for all your help.

Lesson learned: don’t include the ref\_element attribute when selecting the “xpath” option.

---

<div class="post-metadata">

**Author:** ![Russ\_Thomas](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/russ_thomas/32/11884_2.png) [@Russ\_Thomas](https://forum.katalon.com/u/Russ_Thomas)\
**Post date:** [November 15, 2019, 7:10pm UTC](https://forum.katalon.com/t/xpath-not-working-in-katalon-but-works-in-chrome-dev-tools/36185/24 "2019-11-15T19:10:52Z")

</div>



[Previous page](https://forum.katalon.com/t/xpath-not-working-in-katalon-but-works-in-chrome-dev-tools/36185.md?page=1)
