2

I have some issue with selenium-webdrivers on Ubuntu. Everything is working fine instead firefox has no javascript activated. When I open a website that requires javascript it pop the noscipt error. So the website is displaying <noscript>Javascript is required ....

Is there a function to enable JS on Firefox on Ubuntu or das this is a selenium failure and I need to set a driver.

Code:

require 'rubygems'
require 'headless'
require 'selenium-webdriver'
@headless = Headless.new
@headless.start
@driver = Selenium::WebDriver.for :firefox
@driver.navigate.to 'URL'
... actions
@headless.destroy

The Website navigate over HTTP:Headers and Ajax I think.

If someone have an idea I would be thankful.

On dev machine (win 10) all working fine.

Regards

Mat

EDIT

With recent modules you need firefox 65+, because firefox 65+ has his own headless module. Now everything is working fine and fast. Also need recent Geckodriver. Poorly not working with old firefox versions.

h_matze_h
  • 98
  • 1
  • 9

1 Answers1

-1

Refer comment here...

An alternative is to install a Firefox addon that disables JavaScript. This worked for me with Firefox 45 ESR, selenium-webdriver (2.53.4), and capybara (2.8.1):

profile.add_extension(File.expand_path('../quickjava-2.1.0-fx.xpi', FILE))

Configure the extension to disable JavaScript by default.

profile['extensions.thatoneguydotnet.QuickJava.startupStatus.JavaScript'] = 2

Disable loading the extension's first-run tab.

profile['extensions.thatoneguydotnet.QuickJava.curVersion'] = '2.1.0'

Reference : Disabling JavaScript when using Capybara + Selenium

Andy
  • 301
  • 2
  • 9