Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6131971
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:02:37+00:00 2026-05-23T17:02:37+00:00

I use Selenium and Sauce Labs for testing. Is there a Selenium property to

  • 0

I use Selenium and Sauce Labs for testing.

Is there a Selenium property to add a custom header or append a string to the user agent (like “using Sauce Labs”)?

I want to selectively not load some content for Selenium, because it is causing the units tests to be too finicky. I have some widgets on the page, and sometimes the page doesn’t complete loading… so I want to selectively not display them for Selenium.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T17:02:37+00:00Added an answer on May 23, 2026 at 5:02 pm

    I’m not familiar with Sauce Labs, but you can certainly do this on some Selenium setups, by changing the general.useragent.override, as follows (which may be adaptable):

    Using the FirefoxDriver you can:

    FirefoxProfile profile = new FirefoxProfile();
    profile.addAdditionalPreference("general.useragent.override", "some UA string");
    WebDriver driver = new FirefoxDriver(profile);
    

    with Cabybara you can:

    Capybara.register_driver :iphone do |app|
      require 'selenium/webdriver'
      profile = Selenium::WebDriver::Firefox::Profile.new
      profile['general.useragent.override'] = "iPhone"
    
      Capybara::Driver::Selenium.new(app, :profile => profile)
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'd like to use Selenium to automate a few web tasks (not for testing).
We use selenium to run functional testing in our project, and continue to move
We would like to use Selenium to test email content generated from our website.
I've read here and there that we should now use Selenium 2 (WebDriver if
Is there a way to use selenium to test VXML pages? I seem to
Do most people use there selenium (in my case selenium 2 with web driver)
I would like to use Selenium to click on the tab of a web
I have no idea what I do wrong. I would like to use selenium-RC
When I use selenium webdriver with a custom firefox profile I get the firefox
Any one know how to use Selenium 2 with Phpunit? Are there any Selenium

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.