Syntax error with Evaluate JavaScript

Evaluate keyword runs python code - there is no way to use that for evaluating javascript.

Second, you get error because you are essentially passing string <selenium.webdriver..blablabla> (python repr output) into javascript - it obviously fails as it is not js syntax. My js is a bit rusty but essentially your javascript looks like it has other issues too and without firing up proper selenium session, i’d suggest to try this;

Execute Javascript     return arguments[0].value     ARGUMENTS    ${el}

That is the way to pass any values from robot/python side to be used in the js side that runs in the browser. Each argument you place within the actual js code will just be treated as string but if you pass those as argument, they end up in arguments variable in js side with correct typing and thus, can be interacted properly on the js side…

1 Like