0

I need to pass my Robot variable to JavaScript:

${path}=    Set Variable    /apis
${method}=  Set Variable    get
${result}=  Execute Javascript  path_to_file/file.js
Log ${result}   

I'd like to pass ${path} and ${method} to my file.js. Is it possible?

1 Answer 1

1

You will need to use execute javascript to create javascript variables.

For example:

*** Test Cases ***
Example
    ${path}=    Set Variable    /apis
    ${method}=  Set Variable    get

    Execute javascript  path='foobar';
    Execute javascript  method='${method}'

    ${result}=  Execute Javascript  path_to_file/file.js
    Log ${result}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.