TestProject Forum
Powered by leading experts in the test automation community

Disable javascript when running selenium code

How can it be done?
I need to test server side stuff only.

Set up a profile that disables javascript and pass it to your driver constructor:

FirefoxProfile profile = new FirefoxProfile();
profile.setPreference("javascript.enabled", false);
driver = new FirefoxDriver(profile);