Bamboo Tutorial
Introduction Installation Creating projects and plans Cloning (Copying) a build plan Configuring visible projects in Bamboo Editing build plan Changing the plan name Disable plan Delete the build plan Configuring stages, Jobs and Tasks Configuring build plan repositories Adding Scheduled build trigger Adding Repository polling trigger Adding new branch Running a branch Branch actions in Bamboo Configuring build plan permissions Configuring build notifications Expiry of the build history Passing parameters and variables to the build Adding Maven build plan Adding Gradle build plan in Bamboo Adding MSBuild task in Bamboo Adding MSTest task Linux shell build Windows batch command build Windows Powershell build Running the build plans manually build history build logs Bamboo Reports Authors Page in Bamboo Executing Selenium tests in Bamboo Creating and viewing artifacts Running customized build plan Build queue in Bamboo Agents Global Variables User Management Server Capabilities Linked Repositories Group Management Global Permissions Add-ons Management Email server Server address License Information in Bamboo Bamboo System Information Bamboo Audit log Import/Export build plans in Bamboo Build History clean up Bulk edit plan permissions Move build plan in Bamboo Delete build plans Bulk actions in Bamboo Adding deployment project to build plan in Bamboo Web application deployment to tomcat using BambooExecuting selenium tests in bamboo
In this topic, we are going to look at how we can execute Selenium tests in Bamboo. I am assuming that you already know how to work with Maven+JUnit, Maven+TestNG, Gradle+JUnit and Gradle+TestNG projects. In your Selenium project, add few selenium tests as mentioned below. A typical Selenium test project includes few test classes. Each test class extends the base class where in we define before test and after test methods. In before test method, we create the webdriver instance and also perform test initialization tasks. In after test method, we close the driver and also perform clean up tasks like closing processes created during test run. Below is the sample base class for all Selenium Test classes.
package seleniumtests;
import org.junit.Before;
import org.junit.After;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
public class BaseTest {
public WebDriver driver;
@Before
public void init(){
driver = new FirefoxDriver();
}
@After
public void cleanup(){
driver.close();
driver.quit();
}
}
Below is the sample test class. In below test class, we have created a simple test to verify the title of website – www.softpost.org
package seleniumtests;
import org.junit.Assert;
import org.junit.Test;
public class SmokeTests extends BaseTest {
@Test
public void verifyTitle(){
driver.get("https://www.softpost.org");
Assert.assertTrue(driver.getTitle().contains("Free Software Tutorials"));
}
}
After this, all you need to do is push this project on GitHub or your local repository server. Then on Bamboo, you need to create maven buildWeb development and Automation testing
solutions delivered!!