Question: I have this code to execute on robot framework:

```
${result}=   Execute JavaScript   window.document.evaluate("//div[@id='priceBandTableForm:priceBandBox_panel']/div/ul/li[1]/text()", document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;

```

The result is this:

```
${result} = None

```

I have tested the javascript code on chrome console and it works.

Any ideas of what I'm doing wrong?

Answer: 
I have resolved this by adding ".textContent" at the end, and "return" at the beginning.

```
${result}=   Execute JavaScript return   window.document.evaluate("//div[@id='priceBandTableForm:priceBandBox_panel']/div/ul/li[1]/text()", document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue.textContent;

```
Use the **execute javascript** like mentioned below.

```
${textToCompare}=  Execute JavaScript     return document.evaluate('<Your Xpath here>', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue.textContent;

```