Friday 15 May 2015

ruby - Enable/disable javascript using Selenium WebDriver -


For some reason, I have to disable javascript for Firefox (manually, we do the following by following the steps mentioned ). How can it be obtained by Selenium WebDriver using Ruby?

Yes, this is possible. But a different way is the first link to you

  • <> Once you go to the link, try the code below:

      requires Selenium-WebDriver profile = Selenium :: WebDriver :: Firefox :: Profiles.New Profile ["Javascript enabled"] = wrong driver = selenium :: webdriver. Profile (= Firefox, Profile = & gt; Profiles) Profile # = & gt; # Lt: Selenium :: WebDriver :: Firefox :: Profile: 0x89c7568 # @ Extra_prefs = # {"javascript.enabled" = & gt; False, " WebDrive_Firefox_port "= & gt; 7055}, # @ extension = # {webdriver = & gt; ###lt; Selenium :: WebDriver :: Firefox :: Extension: 0x89c6488 #! & Gt; Proxy's Definition = Here Was # @ path = # "/home/kirti/.rvm/gems/ruby-2.0.0-p0/gems/selenium-webdriver-2.33.0/lib/selenium/webdriver/firefox/extension/webdriver.xpi", # @ Should_reap_root = true & gt;}, # @ load_no_foc Us_lib = false, # @model = zero, # @basic_avish = false, # @ safe_sl = false, # @ unreal_ICR = true> gt;   

    Once your browser window shows the above code Open -> Preferences ->

     enable javascript:

No comments:

Post a Comment