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 6033789
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T05:32:05+00:00 2026-05-23T05:32:05+00:00

I need to use Selenium RC on a headless Ubuntu server to run tests

  • 0

I need to use Selenium RC on a headless Ubuntu server to run tests against a website using an external proxy server to simulate a user in a different country.

To test the process, I’ve created a really simple PHPUnit test script, which basically does:

$this->setBrowser("*firefox");
$this->setBrowserUrl("http://www.ipchicken.com/");
$this->open("/");
$this->assertTrue($this->isTextPresent(<proxy ip>));

I start my Selenium RC using these proxy server directives (there’s no authentication on the proxy):

export DISPLAY=":99" && java -Dhttp.proxyHost=<proxy ip> -Dhttp.proxyPort=<proxy port> -jar /var/lib/selenium/selenium-server.jar -avoidProxy

but my test script fails the assertion. If I change the test to assert for my Selenium server IP address, the assertion passes, which makes it look to me as though Selenium is sending the “open” request directly to ipchicken.com, and not sending it through the proxy server.

The selenium server can access the proxy server OK – I’ve tested this with a simple PHP Curl script. If I request ipchicken.com using Curl through the proxy server, it returns the proxy server IP address just fine.

  • 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-23T05:32:06+00:00Added an answer on May 23, 2026 at 5:32 am

    I experienced the same issue trying to get a proxy to work on an Ubuntu system and was unable to get the -Dhttp.proxyHost etc… settings to work. My solution was to export http_proxy prior to the java command – just like you’re doing with the DISPLAY.

    export http_proxy = http://username:password@host:port
    

    Update: Since you are using firefox, you’ll also need to set appropriate proxy settings within firefox. (The hang you mention in your comment is firefox failing to go through the proxy). You’ll need to run the firefox profilemanager with

    firefox -ProfileManager
    

    then create a new profile. Create a new directory for the profile’s path since it will put a large number of files in that location. Within that profile create the appropriate proxy settings. You can now use the firefoxProfileTemplate option with the selenium rc:

     java -jar ..... -firefoxProfileTemplate /path/to/your/new/profile
    

    Note that you’ll only need to run the profile manager once, so thereafter you’ll be able to run headless.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to use a byte array as a profile property in a website.
I need to use the ReSharper Unit Test Runner to run my MSTest Unit
i'm use selenium. i use it by using firefox plugin. but i have problem
At the moment i use selenium using HTMLSuite. The command i use to start
I need to re-run my Selenium test script for unlimited number of times (infinite
I need to use the functions defined in user-extensions.js.We are in a process of
I need to verify using Selenium (or similar framework) that certain HTML content/items are
I am writing some Selenium RC tests using the perl library WWW::Selenium. At the
So I want to get PHUnit up so I can run selenium server, but
I am working on function testing using selenium. But on GUI testing I need

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.