Features
< Back to Blog Overview

PhantomJS and TestingBot

2012-11-30
  • Share on Facebook
  • Share on Twitter
  • Share on LinkedIn
  • Share on HackerNews

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:


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:

TestingBot Logo

Sign up for a Free Trial

Start testing your apps with TestingBot.

No credit card required.

Other Articles

blank

We’re excited to announce that starting from today, our customers can choose to either run their tests on our existing US cloud or on our new Europ...

Read more
TestingBot Browser Extension

TestingBot has released a Chrome Browser Extension and a Firefox Extension, which will allow you to test any webpage, on a remote browser, with t...

Read more
Audio during Mobile App Testing

TestingBot has been providing access to remote physical iOS and Android devices for over 2 years. In the process, we've optimised the process of ...

Read more
Test on macOS Sonoma

TestingBot now offers macOS Sonoma (14.0) beta testing in the cloud. Test your website on Apple's upcoming new macOS version, ahead of the public r...

Read more
Playwright Testing on TestingBot

Playwright is a powerful open-source testing framework, maintained by Microsoft. It is perfect for end-to-end automated testing of websites.It prov...

Read more
Test on Safari Tech Preview and Safari beta

Safari Technology Preview is an experimental browser that Apple releases to developers and users interested in testing upcoming features and improv...

Read more