disable javascript when running selenium code

  • 1 Replies
  • 1596 Views
*

Ali

  • *
  • 8
disable javascript when running selenium code
« on: July 25, 2016, 20:36:15 pm »
How can it be done?
I need to test server side stuff only.

Re: disable javascript when running selenium code
« Reply #1 on: July 26, 2016, 20:16:00 pm »
Set up a profile that disables javascript and pass it to your driver constructor:

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

 

Sitemap 1 2 3 4 5 6 7 8