Search by

Debugging Options

You can use various logging options to debug your failed test cases and fix them with ease.

Text logs

These are a comprehensive record of your test. They are used to identify all the steps executed in the test and troubleshoot errors for the failed step. Text Logs are accessible both from the Automate dashboard, as well as via our REST API to access text logs.

You don’t need to set any options for text logs, as these are enabled by default, and cannot be disabled.

Visual logs

These contain the screenshots that are auto-generated at every Selenium command that your code executes. Visual logs help with debugging the exact step and how the page was rendered when the failure occurred. They also help identify any layout or design related issues with your web pages on different browsers.

Visual logs are disabled by default. You can enable them by using the browserstack.debug capability.

Capability Description Expected values
browserstack.debug Enable visual logs A string. Defaults to false

true if you want to enable the visual logs. false otherwise.

For example, this is how you enable visual logs:

// Enabling visual logs

DesiredCapabilities caps = new DesiredCapabilities();
caps.setCapability("browserstack.debug", "true");
// Enabling visual logs

var capabilities = {
 "browserstack.debug" : "true"
}
// Enabling visual logs

DesiredCapabilities caps = new DesiredCapabilities();
caps.SetCapability("browserstack.debug", "true");
# Enabling visual logs

$caps = array(
 "browserstack.debug" => "true"
);
# Enabling visual logs

capabilities = {
 "browserstack.debug" : "true"
}
# Enabling visual logs

caps = Selenium::WebDriver::Remote::Capabilities.new
caps["browserstack.debug"] = "true"
# Enabling visual logs

my $capabilities = {
 "browserstack.debug" => "true"
}

Video logs

Every test run on the BrowserStack Selenium grid is recorded exactly as it is executed on our remote machine. This feature is particularly helpful whenever a browser test fails, so you can see the entire test in action. You can access these videos from the Automate dashboard for each session. You can also download the videos from the Dashboard or retrieve a link to download the video using our REST API.

Video logs are enabled by default. Note that video recording increases the text execution time slightly. You can disable them by using the browserstack.video capability.

Capability Description Expected values
browserstack.video Enable video recording A string. Defaults to true

true if you want to enable the video recording. false otherwise.

For example, this is how you disable video logs:

// Disabling video logs

DesiredCapabilities caps = new DesiredCapabilities();
caps.setCapability("browserstack.video", "false");
// Disabling video logs

var capabilities = {
 "browserstack.video" : "false"
}
// Disabling video logs

DesiredCapabilities caps = new DesiredCapabilities();
caps.SetCapability("browserstack.video", "false");
# Disabling video logs

$caps = array(
 "browserstack.video" => "false"
);
# Disabling video logs

capabilities = {
 "browserstack.video" : "false"
}
# Disabling video logs

caps = Selenium::WebDriver::Remote::Capabilities.new
caps["browserstack.video"] = "false"
# Disabling video logs

my $capabilities = {
 "browserstack.video" => "false"
}

Console logs

Console Logs capture the browser’s JS console output at various steps of the test to troubleshoot JavaScript issues. You can retrieve Console Logs using both the Automate dashboard, as well as the REST API to access text logs. Currently, this works only for Chrome browsers, and we will roll this out to other browsers soon.

Console logs are enabled by default and are set to errors. You can disable them, or change verbosity options by using the browserstack.console capability.

Capability Description Expected values
browserstack.console Level of console logs to capture A string. Defaults to errors
disabled to disable console logs.
errors to capture errors.
warnings to capture warnings and errors.
info to capture info, warnings and errors.
verbose to capture everything

For example, this is how you disable console logs

// Disabling console logs

DesiredCapabilities caps = new DesiredCapabilities();
caps.setCapability("browserstack.console", "disabled");

If you want to change the console logs level to info, this is how you do it:

// Setting console logs level to info

DesiredCapabilities caps = new DesiredCapabilities();
caps.setCapability("browserstack.console", "info");
// Disabling console logs

var capabilities = {
 "browserstack.console" : "disabled"
}

If you want to change the console logs level to info, this is how you do it:

// Setting console logs level to info

var capabilities = {
 "browserstack.console" : "info"
}
// Disabling console logs

DesiredCapabilities caps = new DesiredCapabilities();
caps.SetCapability("browserstack.console", "disabled");

If you want to change the console logs level to info, this is how you do it:

// Setting console logs level to info

DesiredCapabilities caps = new DesiredCapabilities();
caps.SetCapability("browserstack.console", "info");
# Disabling console logs

$caps = array(
 "browserstack.console" => "disabled"
);

If you want to change the console logs level to info, this is how you do it:

# Setting console logs level to info

$caps = array(
 "browserstack.console" => "info"
);
# Disabling console logs

capabilities = {
 "browserstack.console" : "disabled"
}

If you want to change the console logs level to info, this is how you do it:

# Setting console logs level to info

capabilities = {
 "browserstack.console" : "info"
}
# Disabling console logs

caps = Selenium::WebDriver::Remote::Capabilities.new
caps["browserstack.console"] = "disabled"

If you want to change the console logs level to info, this is how you do it:

# Setting console logs level to info

caps = Selenium::WebDriver::Remote::Capabilities.new
caps["browserstack.console"] = "info"
# Disabling console logs

my $capabilities = {
 "browserstack.console" => "disabled"
}

If you want to change the console logs level to info, this is how you do it:

# Setting console logs level to info

my $capabilities = {
 "browserstack.console" => "info"
}

Network logs

Network Logs capture the browser’s performance data such as network traffic, latency, HTTP requests and responses in the HAR format. You can download network logs using both the Automate dashboard, as well as the REST API to access text logs. You can visualize HAR files using the HAR Viewer.

Network Logs are disabled by default. To enable Network Logs use the browserstack.networkLogs capability.

Capability Description Expected values
browserstack.networkLogs Enable network logs A string. Defaults to false
true if you want to enable network logs. false otherwise.

For example, this is how you enable network logs:

// Enabling network logs

DesiredCapabilities caps = new DesiredCapabilities();
caps.setCapability("browserstack.networkLogs", "true");
// Enabling network logs

var capabilities = {
 "browserstack.networkLogs" : "true"
}
// Enabling network logs

DesiredCapabilities caps = new DesiredCapabilities();
caps.SetCapability("browserstack.networkLogs", "true");
# Enabling network logs

$caps = array(
 "browserstack.networkLogs" => "true"
);
# Enabling network logs

capabilities = {
 "browserstack.networkLogs" : "true"
}
# Enabling network logs

caps = Selenium::WebDriver::Remote::Capabilities.new
caps["browserstack.networkLogs"] = "true"
# Enabling network logs

my $capabilities = {
 "browserstack.networkLogs" => "true"
}