Monday, 27 January 2014

Run Selenium scripts on Cloud - TestingBot | TestNG

Note:  Text in ORANGE can be edited or mentioned important for this entire blog

TestingBot provides similar Browserstack | Saucelabs setup for cloud based automation using Selenium WebDriver.  Given below is a generic test using TestNG from Eclipse IDE that run on TestingBot cloud server. 

1| Log into
2| Obtain the Client Key and Client Secret from Account.
3| Make use of the following script and do edit whenever necessary.

package packagename;


import org.openqa.selenium.By;
import org.openqa.selenium.Platform;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.testng.Assert;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

public class Classname {
private WebDriver driver;

public void setUp() throws Exception {
DesiredCapabilities capabillities = DesiredCapabilities.firefox();
capabillities.setCapability("version", "24");
capabillities.setCapability("platform", Platform.WINDOWS);
capabillities.setCapability("name", "Test01");
driver = new RemoteWebDriver(
new URL(

public void test01() throws Exception {
WebElement element = driver.findElement("gbqfq"));
Assert.assertEquals("selenium - Google Search", driver.getTitle());

public void tearDown() throws Exception {

4| Got to Tests Tab and get your logs.

TestingBot also lets you run the test through online site.
Follow the steps mentioned below:

1| Open Selenium IDE and record your tests.
2| Save the test suite in HTML format.
3| Log into
4| Now, try to upload the tests in testingbot site... click on the link.
5| Click 'Choose File' and select already saved html file.
6| Click 'Start a test from scratch'.
7| Name the Test and provide the base URL.
8| Now, select the browser and OS platform.
9| Save settings
10| Click, 'Run this test now'.
11| Go to 'Tests' Tab and get the logs.