I have a cucumber test suite I want to run in Internet Explorer environment the problem is that I am on a linux machine. So I thried to follow this, somewhat outdated, guide.
I’m using a local VM to try and run the tests on and there I have started the standalone selenium server which tells me that:
RemoteWebDriver instances should connect to: http://127.0.0.1:4444/wb/hub
Now this seems a bit odd that I have localhost here as connect to but no matter it’s on the same physical machine so should pose no problems or?
Well next in my env.rb I have defined the following:
Capybara.app_host = "http://hostname:4444"
Capybara.default_driver = :selenium
Capybara.register_driver :selenium do |app|
Capybara::Selenium::Driver.new(app,
:browser => :remote,
:url => "http://MYNETWORKIP:4444/wd/hub",
:desired_capabilities => :internet_explorer)
end
as the guide suggests. But when I run the test I get the following error:
bad URI(is not URI?): 127.0.0.1:4444/wd/hub (URI::InvalidURIError)
I suspect it has something to do with me being behind a proxy since I needed to do some special settings for Firefox(iceweasel) to run.
Those settings were:
Capybara.register_driver :selenium do |app|
profile = Selenium::WebDriver::Firefox::Profile.new
profile["network.proxy.type"] = 2
profile["network.proxy.autoconfig_url"] = "http config adress here"
profile["network.proxy.no_proxies_on"] = "localhost, 127.0.0.1, #{%x[hostname].gsub("\n", "")}"
profile["network.proxy.http"] = "proxy http address here"
profile["network.proxy.http_port"] = 3128
profile["network.proxy.ssl"] = "ssl proxy http address here"
profile["network.proxy.ssl_port"] = 3128
profile["network.proxy.share_proxy_settings"] = true
Capybara::Selenium::Driver.new(app, :profile => profile)
end
Spent alot of time trying to get this to work now so I need some help
Thx in advance
EDIT:
Realized that some versions might be of help.
From gemfile:
cucumber (1.1.9)
rails (2.3.11)
selenium-webdriver (2.20.0)
EDIT 2:
Further tries with changing the url to my network ip address gives me another error:
both URI are relative (URI::BadURIError)
EDIT 3:
Now with the help of Jon M I get a bit further but encountering:
unexpected response, code=404, content-type="text/html"
EDIT 4:
Latest update:
Changed the connection settings in my env.rb
This gives me a connection to my virtualbox and starts up my IE browser YAY!
BUT! It cannot connect to the application.
I expect the ‘bad URI’ message is due to the missing protocol – try prefixing ‘127.0.0.1:4444/wd/hub’ with ‘http://’
Edit (in response to your update):
Just spotted the address… 127.0.0.1 refers to
localhost, but if the Selenium server is running on a different machine, surely you should be using the IP address of that machine?e.g. http://some.other.ip:4444/wd/hub