# Robot can't get element content although its on the screen

**URL:** <https://forum.robotframework.org/t/robot-cant-get-element-content-although-its-on-the-screen/3085>\
**Category:** SeleniumLibrary\
**Created:** [13 January 2022 10:12 UTC](https://forum.robotframework.org/t/robot-cant-get-element-content-although-its-on-the-screen/3085 "2022-01-13T10:12:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![resourceful-idiot](https://avatars.discourse-cdn.com/v4/letter/r/ba9def/32.png) [@resourceful-idiot](https://forum.robotframework.org/u/resourceful-idiot)\
**Post date:** [13 January 2022 10:12 UTC](https://forum.robotframework.org/t/robot-cant-get-element-content-although-its-on-the-screen/3085/1 "2022-01-13T10:12:38Z")

</div>

I want to verify this text appears on a web page, should be easy:

```
<div _ngcontent-ng-cli-universal-c98="" class="figure-caption">MY-IMG-TEXT</div>

```

This is the script:

```
 Sleep 10s
Wait Until Page Contains MY-IMG-TEXT

```

…but I’m getting: fail even though the text is there on the screenshot

FAIL Message: Text ‘MY-IMG-TEXT’ did not appear in 5 seconds.

The App is written in Angular 12 but other elements are being detected ok. I’m not using any particular Angular library and don’t really want to have to install custom one if possible.

```
Python 3.7.8
requests 2.26.0
robotframework 4.1.1
robotframework-extendedrequestslibrary 0.5.5
robotframework-pythonlibcore 3.0.0
robotframework-seleniumlibrary 5.1.3
selenium 4.0.0
urllib3 1.26.7
```

---

<div class="post-metadata">

**Author:** ![EdManlove](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/edmanlove/32/1002_2.png) [@EdManlove](https://forum.robotframework.org/u/EdManlove)\
**Post date:** [13 January 2022 12:08 UTC](https://forum.robotframework.org/t/robot-cant-get-element-content-although-its-on-the-screen/3085/2 "2022-01-13T12:08:22Z")

</div>

If you have not already tried, one thing to check is to make sure those are hyphens and not some sort of unicode hyphens or dash. [Dashes and hyphens](https://jkorpela.fi/dashes.html)

---

<div class="post-metadata">

**Author:** ![resourceful-idiot](https://avatars.discourse-cdn.com/v4/letter/r/ba9def/32.png) [@resourceful-idiot](https://forum.robotframework.org/u/resourceful-idiot)\
**Post date:** [13 January 2022 14:16 UTC](https://forum.robotframework.org/t/robot-cant-get-element-content-although-its-on-the-screen/3085/3 "2022-01-13T14:16:52Z")

</div>

Hi, thank you I’ve tried using `\x2d` still does not recognize the text. The original text is this:

`Fig. 1 - My Figure Description - Top View`

---

<div class="post-metadata">

**Author:** ![EdManlove](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/edmanlove/32/1002_2.png) [@EdManlove](https://forum.robotframework.org/u/EdManlove)\
**Post date:** [13 January 2022 14:25 UTC](https://forum.robotframework.org/t/robot-cant-get-element-content-although-its-on-the-screen/3085/4 "2022-01-13T14:25:05Z")

</div>

I would check the log.html as page should contain should have the full html code of the page. If it is not there by default, you may need to increase the loglevel to either DEBUG or TRACE. That would give you a chance to double check the text even though you see it there visually.

---

<div class="post-metadata">

**Author:** ![resourceful-idiot](https://avatars.discourse-cdn.com/v4/letter/r/ba9def/32.png) [@resourceful-idiot](https://forum.robotframework.org/u/resourceful-idiot)\
**Post date:** [13 January 2022 15:40 UTC](https://forum.robotframework.org/t/robot-cant-get-element-content-although-its-on-the-screen/3085/5 "2022-01-13T15:40:18Z")

</div>

I have discovered an extra white space in the text that is causing the issue. Thank you for your help.
