# Unexpected token while parsing selector error

**URL:** <https://forum.robotframework.org/t/unexpected-token-while-parsing-selector-error/6658>\
**Category:** Browser\
**Created:** [15 January 2024 08:35 UTC](https://forum.robotframework.org/t/unexpected-token-while-parsing-selector-error/6658 "2024-01-15T08:35:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aero10](https://avatars.discourse-cdn.com/v4/letter/a/c4cdca/32.png) [@Aero10](https://forum.robotframework.org/u/Aero10)\
**Post date:** [15 January 2024 08:35 UTC](https://forum.robotframework.org/t/unexpected-token-while-parsing-selector-error/6658/1 "2024-01-15T08:35:29Z")

</div>

Hello all,  
I am having trouble using Get Element States keyword. This line:

```
Get Element States //div[text()=' CODE 540001 '] contains visible 

```

Returns an error:

> Error: locator.waitFor: Unexpected token “” while parsing selector “”

I will appreciate any tips. I had no luck with what I tried so far (double quotes in selector, adding parent element…).

Thank you and best regards,  
JC

Edit:  
I believe I caused this issue by setting selector prefix to ${EMPTY}.  
I need this because I am switching in and out of iframe.  
Everything worked great until I started using Get Element States keyword, so I will need to find a workaround for it.
