[Selenium RC Java] Getting "Cannot call method 'indexOf' of undefined" exception while trying to open url in Chrome

282 views
Skip to first unread message

Sella ra

unread,
Oct 16, 2010, 1:49:27 AM10/16/10
to seleniu...@googlegroups.com
Hi,

In Chrome browser,I am getting "Cannot call method 'indexOf' of undefined" exception while trying to navigate to the url of the application under test.
I am using Selenium RC and Java.

Please help me with this.



Varun Mahajan

unread,
Oct 16, 2010, 6:59:03 AM10/16/10
to Selenium Users
I used the following workaround for Chrome, and it worked for me. You
basically need to pass the '--disable-web-security' flag to the
GoogleChromeLauncher class. One option is to modify source code and
rebuild the selenium-server.jar, but an easier approach is to set a
commandLine flag on a BrowserConfigurationOptions object and pass that
to selenium.start()

For example,

DefaultSelenium selenium = new DefaultSelenium(location, port,
browser, targetPath);
BrowserConfigurationOptions bco = new BrowserConfigurationOptions();
selenium.start(bco.setCommandLineFlags("--disable-web-security"));

Sella ra

unread,
Oct 17, 2010, 8:35:57 AM10/17/10
to seleniu...@googlegroups.com
Thanks lot for your reply.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.


Reply all
Reply to author
Forward
0 new messages