This is a way to do it if you use WebDriver with FireFox:
FirefoxProfile p = new FirefoxProfile();
p.setPreference("javascript.enabled", false);
driver = new FirefoxDriver(p);
More Related Contents:
- ‘innerText’ works in IE, but not in Firefox
- new Date() is working in Chrome but not Firefox
- ES2015 import doesn’t work (even at top-level) in Firefox
- My very simple Greasemonkey script is not running?
- Accessing Variables from Greasemonkey to Page & vice versa
- Cryptic “Script Error.” reported in Javascript in Chrome and Firefox
- JavaScript getter for all properties
- Accessing the content of other tabs in a browser
- Open IE browser in Firefox/Chrome page
- Selenium Datepicker using JavascriptExecutor
- Using JavaScript to edit CSS gradient
- “not well-formed” error in Firefox when loading JSON file with XMLHttpRequest
- Missing click event for inside element on firefox
- Is “localStorage” in Firefox only working when the page is online?
- Why aren’t Safari or Firefox able to process audio data from MediaElementSource?
- Custom browser actions in Protractor
- Firebug says “No Javascript on this page”, even though JavaScript does exist on the page
- windows.location.href not working on Firefox3
- What is this JavaScript syntax: {Ci, CC}? [duplicate]
- Opening a file in local file system in javascript
- An error has occured in ‘site url’: Uncaught TypeError: Cannot read property ‘getColomnSet’ of undefined with Selenium and Python
- Why is a function declaration within a condition block hoisted to function scope in Chrome but not Firefox?
- Download attribute not working in Firefox
- How can I inspect disappearing element in a browser?
- Why are function declarations handled differently in different browsers?
- Focus tab or window
- onKeyPress event in Firefox and IE8
- Synchronous XMLHttpRequest on the main thread is deprecated
- Disable images in Selenium Python
- Using cross-platform keyboard shortcuts in end-to-end testing