TestingBot Breakpoints to debug your flakey Selenium tests

Today TestingBot has added a new feature that should help you debug issues you encounter when running automated tests.

Suppose you’re running a test and you notice something isn’t quite working well (ajax request is failing, javascript errors, …).
When this happens, it’d be easy to simply pause the test, log in on the pristine virtual machine and start debugging with mouse and keyboard straight from your browser.
You could fire up Developer Tools and inspect the javascript errors, or inspect the ajax requests for problems.

With our new breakpoint feature, you can pause a running test at any time and immediately control the browser with your mouse and keyboard.

Screen Shot 2015-09-28 at 8.22.19 AM

When your test starts running, it will appear in our member dashboard.
Navigating to the test detail page, you will see a “Breakpoint/Pause” button, if you click that the test will be paused and you will be able to control the browser from that page.

If you’re looking to pause a test from within your test, that’s possible as well.
Suppose you’re writing a test and need to inspect the browser at a specific point in your test, you can send TestingBot a command to pause the test.
Once the command is sent, you navigate to the test detail page and can immediately control the browser for debugging.

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

caps = {
:browserName => "internet explorer",
:version => "10",
:platform => "WIN8"
}

urlhub = "http://key:secret@hub.testingbot.com/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.manage.window.resize_to(800, 600)
@webdriver.navigate.to "https://testingbot.com"
if @webdriver.title != "TestingBot"
# something is not right, pause this test so we can inspect on TestingBot
@webdriver.execute_script("testingbot: break")
end
@webdriver.quit

We hope this new feature will help you with your Selenium tests. If you have any comments or suggestions, please let us know!

No Comments

Leave a Reply

Your email address will not be published. Required fields are marked *