---
title: PhantomJS on TestingBot | TestingBot Blog
description: Running tests with PhantomJS
source_url:
  html: https://testingbot.com/blog/2012/11/30/phantomjs-headless-testing-with-selenium-webdriver-and-testingbot
  md: https://testingbot.com/blog/2012/11/30/phantomjs-headless-testing-with-selenium-webdriver-and-testingbot.md
---

# PhantomJS and TestingBot

Running tests with PhantomJS

By [Jochen D.](https://testingbot.com/about/jochen-d)2012-11-30

 Share on Facebook 

 Share on Twitter 

 Post on Reddit 

 Share link 

Today we have added PhantomJS to our Linux VMs on our Selenium Grid. You can now run your WebDriver tests on PhantomJS + Ubuntu.

PhantomJS is a headless WebKit solution which is very fast, it does not suffer from slow browser startup times or other issues you might encounter with browsers.

Together with Ivan De Marino’s GhostDriver, we can now run Selenium WebDriver tests with PhantomJS. An example of how to run a simple test with Ruby and PhantomJS on our grid:

```ruby
caps = {
  :browserName => "phantomjs",
  :platform => "LINUX"
}
 
urlhub = "http://key:secret@hub.testingbot.com:4444/wd/hub"
 
client = Selenium::WebDriver::Remote::Http::Default.new
client.timeout = 120
 
@webdriver = Selenium::WebDriver.for :remote, :url => urlhub, :desired_capabilities => caps, :http_client => client
@webdriver.navigate.to "http://www.google.com/"
puts @webdriver.title
@webdriver.save_screenshot("./screenshot.png")
@webdriver.quit
```

The example above will open the homepage of Google, print the title of the homepage and save a screenshot of the page on your harddisk. As PhantomJS and GhostDriver will be improved and updated in the future, we will keep on updating these on our Linux VMs.

Together with Ubuntu, PhantomJS is very fast: PhantomJS + GhostDriver Ubuntu on our grid:

[← Previous post Windows 8/Windows 2012 Selenium Testing](https://testingbot.com/blog/2012/11/26/windows-8windows-2012-selenium-testing) [Next post → Travis CI Selenium testing with TestingBot](https://testingbot.com/blog/2012/12/31/travis-ci-selenium-testing-with-testingbot)

## Sidebar

### TestingBot Cloud Testing

Run automated, manual and visual tests on remote browsers and devices. Sign up for a free trial.

[Free Trial](https://testingbot.com/users/sign_up)

### Latest articles

[![Announcing AI Test Insights](https://testingbot.com/assets/blog/2026/ai-insights.jpg)](https://testingbot.com/blog/ai-test-insights)

#### Announcing AI Test Insights

Use AI Insights to quickly discover why an automated test...

[Read: Announcing AI Test Insights](https://testingbot.com/blog/ai-test-insights)

[![Selenium vs Playwright 2026](https://testingbot.com/assets/blog/2026/selenium-vs-playwright-2026.jpg)](https://testingbot.com/blog/selenium-vs-playwright)

#### Selenium vs Playwright 2026

Comparing Selenium vs Playwright - which is the best test...

[Read: Selenium vs Playwright 2026](https://testingbot.com/blog/selenium-vs-playwright)

[![Maestro Physical Device Testing](https://testingbot.com/assets/blog/2026/maestro-physical.jpg)](https://testingbot.com/blog/maestro-physical-device-testing)

#### Maestro Physical Device Testing

Maestro testing in parallel on physical Android and iOS d...

[Read: Maestro Physical Device Testing](https://testingbot.com/blog/maestro-physical-device-testing)

## Related Articles

[![Selenium vs Playwright 2026](https://testingbot.com/assets/blog/2026/selenium-vs-playwright-2026.jpg)](https://testingbot.com/blog/selenium-vs-playwright "Selenium vs Playwright 2026")

### [Selenium vs Playwright 2026](https://testingbot.com/blog/selenium-vs-playwright)

Comparing Selenium vs Playwright - which is the best test framework for your usecase?

[Read article →](https://testingbot.com/blog/selenium-vs-playwright)

[![February 2023 Product Updates](https://testingbot.com/assets/blog/2023/feb_prod_update.jpg)](https://testingbot.com/blog/february-2023-updates "February 2023 Product Updates")

### [February 2023 Product Updates](https://testingbot.com/blog/february-2023-updates)

An overview of the exciting new features released on TestingBot in February.

[Read article →](https://testingbot.com/blog/february-2023-updates)

[![Selenium 20th birthday](https://testingbot.com/assets/blog/2024/selenium20.webp)](https://testingbot.com/blog/selenium-20-years "Selenium 20th birthday")

### [Selenium 20th birthday](https://testingbot.com/blog/selenium-20-years)

Celebrate Selenium's 20th birthday. An overview of the years.

[Read article →](https://testingbot.com/blog/selenium-20-years)

[![Playwright Testing on TestingBot](https://testingbot.com/assets/blog/2023/playwright-testing.jpg)](https://testingbot.com/blog/playwright-testing-introduction "Playwright Testing on TestingBot")

### [Playwright Testing on TestingBot](https://testingbot.com/blog/playwright-testing-introduction)

Learn how Playwright can run your automated tests on a variety of browsers, local or remote browsers on TestingBot.

[Read article →](https://testingbot.com/blog/playwright-testing-introduction)

## More by Jochen D.

[![Announcing AI Test Insights](https://testingbot.com/assets/blog/2026/ai-insights.jpg)](https://testingbot.com/blog/ai-test-insights "Announcing AI Test Insights")
### [Announcing AI Test Insights](https://testingbot.com/blog/ai-test-insights)

Use AI Insights to quickly discover why an automated test failed.

[![Maestro Physical Device Testing](https://testingbot.com/assets/blog/2026/maestro-physical.jpg)](https://testingbot.com/blog/maestro-physical-device-testing "Maestro Physical Device Testing")
### [Maestro Physical Device Testing](https://testingbot.com/blog/maestro-physical-device-testing)

Maestro testing in parallel on physical Android and iOS devices.

[![tvOS Physical Device Testing](https://testingbot.com/assets/blog/2025/appletv.jpg)](https://testingbot.com/blog/tvos-automated-testing "tvOS Physical Device Testing")
### [tvOS Physical Device Testing](https://testingbot.com/blog/tvos-automated-testing)

Run automated tvOS tests on physical AppleTV devices.

[See all posts by Jochen D. →](https://testingbot.com/about/jochen-d)

## Ready to start testing?
[Start a free trial](https://testingbot.com/users/sign_up)
