# Evaluate Javascript in Browser

**URL:** <https://forum.robotframework.org/t/evaluate-javascript-in-browser/5495>\
**Category:** Browser\
**Created:** [25 March 2023 21:23 UTC](https://forum.robotframework.org/t/evaluate-javascript-in-browser/5495 "2023-03-25T21:23:11Z")\
**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:** [25 March 2023 21:23 UTC](https://forum.robotframework.org/t/evaluate-javascript-in-browser/5495/1 "2023-03-25T21:23:11Z")

</div>

Hello all,

I am having trouble getting JavaScript execution to work with Browser. I am trying to use [Evaluate JavaScript](https://marketsquare.github.io/robotframework-browser/Browser.html#Evaluate%20JavaScript) keyword.

I would like to check when page is loaded. If there is a better approach to that, suggestions are welcome. I tried with:

```
Wait Until Page is Loaded
    Evaluate JavaScript selector=None (elem) => while (document.readyState != "complete")

```

I get the following error:

Keyword ‘Browser.Evaluate JavaScript’ got unexpected named argument '(elem) '.

Can you help me figure how to use the keyword correctly please?

Thanks  
A
