Archive for March, 2012

iPhone and iPad Selenium Testing with Webdriver

Since our last post announcing Mac OS X Selenium support, we now have added iPhone and iPad to the mix.

You can now run your Selenium webdriver tests on iPad and iPhone (iOS 5.1) inside our grid.
Testing on iPad and iPhone happens with the official iOS Simulator from Apple and comes with a video and screenshots of the test.

At TestingBot we understand that mobile testing is becoming increasingly important, so that’s why we are dedicated to provide you with the best solutions for mobile Selenium testing.

A simple example of how to run your first test on TestingBot:

require "rubygems"
require 'testingbot'
gem "selenium-client"
gem "selenium-webdriver"
require "selenium-webdriver"
require "selenium/client"

caps = {
  :browserName => "iphone", # or ipad
  :platform => "MAC"
}
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 "https://www.google.com/"
puts webdriver.title
webdriver.quit

You can find more info about our iOS and Android support in our mobile support area.

We look forward to your comments and suggestions.

VN:F [1.9.22_1171]
Rating: 7.8/10 (9 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

Mac OS X Selenium testing. Webdriver and Selenium RC testing with Apple.

We will make a lot of people happy with this announcement: today we start providing our customers with Mac OS X testing on-demand.
Next to testing on Windows (2008/2003), Linux and Android we now finally provide testing on Apple’s OS.

We provide a video and screenshots of your test running on OS X, just like we do with all the other platforms we support.
An example in Ruby of running a test on the mac would be:

require "rubygems"
require 'testingbot' 
gem "selenium-client"
gem "selenium-webdriver"
require "selenium-webdriver" 
require "selenium/client"

caps = {
  :browserName => "firefox",
  :platform => "MAC"
}
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.testingbot.com/"
puts webdriver.title
webdriver.quit

The browsers we currently support on MAC are:

  • Firefox 11
  • Safari 5
  • Google Chrome

List of all browsers/OS versions we support: browsers

OS X testing is available in beta to our customers (excluding free trials). Enjoy!

VN:F [1.9.22_1171]
Rating: 10.0/10 (1 vote cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

Samsung Galaxy Tab Testing with Selenium Webdriver

We are pleased to announce that we have added Samsung Galaxy Tab testing to our Selenium grid.

Starting today our paying customers can run their tests on Samsung Galaxy Tab emulators running on a Linux node. These nodes are optimized to run the emulator with enough RAM and CPU.

As always, you will have access to all test results together with screenshots and a video of the test.

In the following example you will see a simple Ruby script using Webdriver to test on a Galaxy Tab in our cloud:

require "rubygems"
gem "selenium-client"
gem "selenium-webdriver"
require "selenium-webdriver"
require "selenium/client"

caps = {
  :browserName => "galaxytab",
  :platform => "ANDROID"
}

client = Selenium::WebDriver::Remote::Http::Default.new
client.timeout = 480

driver = Selenium::WebDriver.for(
  :remote,
  :url => "http://key:secret@hub.testingbot.com:4444/wd/hub",
  :http_client => client,
  :desired_capabilities => caps)
driver.navigate.to "http://www.google.com"
element = driver.find_element(:name, 'q')
element.send_keys "Hello WebDriver!"
element.submit
puts driver.title
driver.quit

By modifying the browserName in the example above to “android”, you can also run your test on our Android Ice Cream Sandwich Phone emulator.
More information is available in our support area.

In the meantime we are working on supporting more mobile devices in our cloud, so stay tuned for further updates. To see a full list of browsers/devices/OS versions we support, please consult our browser page.

VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

Selenium Testing on Linux Ubuntu

We are pleased to announce we now support Linux (Ubuntu 11.10) on our Selenium grid.

You can now run your cross browser tests on Linux instances, containing the following browsers:

  • Firefox 11
  • Firefox 10
  • Firefox 9
  • Firefox 8
  • Firefox 3
  • Google Chrome

As with our Windows nodes, we provide screenshots and a video of each test on Ubuntu.
We optimized the screenshots and video processing on our Linux nodes, so rest assured this will not slow down your tests.

Linux Selenium Testing will be available starting from today to all our users (paying and trial accounts).
In our TestLab you can now choose between Linux and Windows browsers.

To see a full list of the browsers and OS combinations we support, please see our browsers page.

VN:F [1.9.22_1171]
Rating: 10.0/10 (3 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

Website Monitoring and PageLoad Testing with Selenium

Next to running automated browser tests, Selenium and TestingBot can be used for other tasks like monitoring a website, or verifying that the pageload time of a page is below a certain threshold.

With our TestLab we run your Selenium tests when you want, how many times you want.

Website Monitoring a specific string of text

Let’s say for example  that you want to test your website every 5 minutes, and you want to check for a certain piece of text to be on the page (just to make sure you’re not seeing an error page but the real page).
Setting this up is easy with our TestLab:

Sign up for a free account, click “Test Lab” and choose “start a test from scratch”.
Enter a name and URL of the website you want to monitor/test.

Next, let’s add a step which will verify that a certain piece of text is on the mainpage of our website.
Click “Add step” to add a new step to this test.

Choose “Assertion”, and pick the “verifyTextPresent” command.
As a pattern, fill in the piece of text you want to verify on the page.
In our case, we want to make sure that our homepage contains the word TestingBot at all times.

Now let’s specify when and how many times this check should be run.

In this example, we specify that we want this monitoring check to be executed every 10 minutes.

We can now add alerts to make sure we’re alerted immediately when something does go wrong.
TestingBot supports alerts via e-mail, SMS and prowl (push messages).

This test will now run every 5 minutes and will alert you as soon as the piece of text you expect to be on your website is no longer there.

PageLoad Test with Selenium

A bit more advanced but very useful is a test which will check the pageload time of your website.
We can calculate the user perceived pageload time of a webpage by storing the current time at the head of your page and then at the end of the page you subtract the current time with the time you stored at the top of your page.

In short, in your head you would add a piece of javascript code:


window._startTime = (new Date()).getTime();

and at the end of the page, you declare a global function:


window.getLoadTime = function() { return ((new Date()).getTime() - window._startTime); }

window.getLoadTime will now return the pageload time in milliseconds.

You can add a verifyEval test step in our TestLab which will verify if the pageload time is below a certain threshold, in this example 9000 milliseconds.
If this is not the case, an alert will be sent so you know something is wrong.

With these examples we hope to convince you that Selenium and TestingBot is a very useful tool for every website owner.
Whether you want to test your website in various browsers or prefer simple website monitoring, it’s all possible with TestingBot and Selenium.

VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)