# Run JavaScript Code

Runs JavaScript code on a web page in the specified browser tab.

<table data-header-hidden><thead><tr><th width="257" valign="top"></th><th width="302" valign="top"></th></tr></thead><tbody><tr><td valign="top">Process ID</td><td valign="top"><p>[Link] A variable that stores the process and tab ID of the browser used by this block.</p><p>If the property is left empty, or if the "Process ID" variable was not previously assigned at the time of opening the browser, the application and browser tab will be determined from the content of the corresponding selector line.</p><p>The process ID can be obtained, for example, using the "Run IE", "Run Chrome", or "Join Browser" blocks.</p></td></tr><tr><td valign="top">JS Code</td><td valign="top"><p>[Text] The JavaScript code that needs to be executed on the page in the specified browser tab.</p><p>For example, <code>"alert('Test');"</code>.</p></td></tr><tr><td valign="top">Delay Before</td><td valign="top">[Number] Delay in seconds before executing the block.</td></tr><tr><td valign="top">Delay After</td><td valign="top">[Number] Delay in seconds after executing the block.</td></tr><tr><td valign="top">Timeout</td><td valign="top">[Number] The maximum timeout for script execution in seconds.</td></tr><tr><td valign="top">Number of Retries</td><td valign="top">[Number] The number of retries in case of an error. In this case, it will reconnect to the current tab and wait for a 3-second pause before each attempt.</td></tr><tr><td valign="top">Result</td><td valign="top">[String] The result of executing the code on the page. To return a value in the script, the return statement must be specified.</td></tr><tr><td valign="top">Error Handling Level</td><td valign="top"><p>Select the error handling level. Possible values:</p><ul><li>"Default" - by default;</li><li>"Ignore" - errors are ignored;</li><li>"Handle" - errors are handled.</li></ul><p>If "Default" is selected, the value of the "Start" block of this diagram will be used.</p></td></tr><tr><td valign="top">Message Level</td><td valign="top"><p>Select the message level that the blocks will output during operation. Possible values:</p><ul><li>"Default" - by default;</li><li>"Release" - output is disabled;</li><li>"Debug" - main information output;</li><li>"Detailed" - detailed information output.</li></ul><p>If "Default" is selected, the value of the "Start" block of this diagram will be used.</p></td></tr><tr><td valign="top">Error Text</td><td valign="top">[Text] Returns detailed information about the error in case of incorrect execution of the block.</td></tr></tbody></table>
