How to Implement addScript and RunScript

1,351 views
Skip to first unread message

Bhargavan

unread,
Feb 26, 2013, 4:32:33 AM2/26/13
to seleniu...@googlegroups.com
Hello,

Can any one provide one example on how to implement addScript and runScript in Selenium IDE.

When i tried to add command like this,

<tr>
    <td>addScript</td>
    <td>selenium.browserbot.getCurrentWindow().document.write('hello');</td>
    <td></td>
</tr>
I am getting the following error.

  • [error] Unexpected Exception: fileName -> chrome://selenium-ide/content/selenium-core/scripts/selenium-api.js, lineNumber -> 3176, columnNumber -> 4


Thanks,

Sundeep Gupta

unread,
Feb 26, 2013, 11:50:31 AM2/26/13
to seleniu...@googlegroups.com
runScript is working for me in Selenium IDE
I tried :
<tr>
<td>runScript</td>
<td>document.title = &quot;MyName&quot;;</td>
<td></td>
</tr>

This did changed the title of the window.
  1. But when I called 'selenium.browserbot.getCurrentWindow().document.title', it failed with console error 'selenium.browserbot is undefined.'
For addScript, I am getting same error (even for document.title). 

Checked the 'selenium-api.js'. The line where the error is occurring is this :

Line 3176: head.appendChild(script);

Waiting for experts to reply.

/Sundeep
Reply all
Reply to author
Forward
0 new messages