Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I want to know current user-agent. I have used selenium2 with ruby

I have set user-agent in env.rb

  Capybara.default_driver = :selenium
  Capybara.register_driver :selenium do |app|

  profile = Selenium::WebDriver::Firefox::Profile.new
  profile['general.useragent.override'] = "Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A293 Safari/6531.22.7"

  Capybara::Selenium::Driver.new(app, {:browser => :firefox, :profile =>  profile})
end

And when run cucumber test cases opened FireFox Browser and I does not see iphone. SO I want to check test cases is running in with iphone mode(user-agent). How can I do that?

share|improve this question

1 Answer

try out this:-

page.driver.browser.browser

=> 

:firefox
share

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.