Features
- Running Selenium Scripts in Python, Ruby, Java, and CSharp on CrossBrowserTesting.com
- Automated Starting and Stopping of the CrossBrowserTesting.com NodeJS local tunnel to test local and development webpages behind your firewall
- Enable Test Views with links view videos and packet captures for Selenium scripts
Installation
via the interface
- Click the Administration.
- Click Plugins List.
- Click the Upload plugin zip.
- Add the zip file of the CrossBrowserTesting Plugin. Click Save.
- Restart the TeamCity server.
by hand (not recommended)
- Download crossbrowsertestingPlugin.zip.
- Save the downloaded zip file into your `<TeamCity Data Directory>/plugins` directory.
- Restart the TeamCity server.
Configuration
Environment Variables
The CrossBrowserTesting.com TeamCity Plugin passes your build step information to your Selenium scripts as environment variables. The exact syntax will vary depending on your scripting language.
| Variable | Description |
| CBT_USERNAME | the username used on CrossBrowserTesting.com for Selenium Testing |
| CBT_APIKEY | the apikey used on CrossBrowserTesting.com for Selenium Testing |
| CBT_BUILD_NAME | the TeamCity Project’s name |
| CBT_BUILD_NUMBER | the TeamCity Project’s current build number |
| CBT_OPERATING_SYSTEM | the apiname of the selected Operating System |
| CBT_BROWSER | the apiname of the selected Browser |
| CBT_BROWSERS | an array of JSON objects containing the “operating_system”, “browser”, “resolution, and “browserName” of each configuration specified |
| CBT_RESOLUTION | the name of the selected Screen Resolution |
Build/Configure
Build Feature
- Configure your TeamCity Project
- Configure your Project Build (In Edit Configuration Settings)
- In Build Features, Select Add Build Feature
- From the dropdown, select CrossBrowserTesting.com Build Feature
- Input your CrossBrowserTesting.com User Name and API Key in the corresponding text boxes.
- Add the Operating System, Browser, and Screen Resolution that you want to run a Selenium Test on.
- Optional: Select Use Local Tunnel tests on webpages behind your firewall.
- Optional: Select Enable Test Results Pages.During your build, links on your sidebar will populate and allow you to interact with the test. You can view videos, snapshots, and network packet captures for Selenium Tests.
- Click Save.
Execute a Selenium Test
- Execute a Selenium Test just as normally would with TeamCity.
- For example, if you were running a script written in python on a Unix machine, within the Build Steps, select Add Build Step and Command line.
- Enter the command to run your script ie. “python your_selenium_script.py”
- Click Run to run the selenium test.
Output
Results from you selenium test will output in the Build Log for that build.