Yes it is possible. But in a different way. First you need to look at the link
As soon as you follow the link, try the code below:
require 'selenium-webdriver' profile = Selenium::WebDriver::Firefox::Profile.new profile["javascript.enabled"] = false driver = Selenium::WebDriver.for(:firefox, :profile => profile) profile
As soon as your browser window opens through the above code, then check the settings from Edit-> Settings-> content , then you will see that Enable JavaScript: is not checked.

source share