You can use various logging options to debug your failed test cases and fix them with ease.
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.
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"
}
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 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 disable 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", "disable");
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" : "disable"
}
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", "disable");
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" => "disable"
);
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" : "disable"
}
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"] = "disable"
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" => "disable"
}
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 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. |
browserstack.networkLogsOptions |
Configure network logs | A JSON. Network logs can further be customized using the browserstack.networkLogsOptions capability. |
For the list of available configurations in browserstack.networkLogsOptions
capability refer the table below:
Network log configuration | Description | Expected values |
---|---|---|
captureContent |
Captures request and response payload. | Defaults to false . By default network logs does not capture request and response payload. In order to capture request and response payload set captureContent to true |
For example, this is how you can use network logs:
DesiredCapabilities caps = new DesiredCapabilities();
HashMap<String, Boolean> networkLogsOptions = new HashMap<>();
networkLogsOptions.put("captureContent", "true");
capability.setCapability("browserstack.networkLogs", "true");
capability.setCapability("browserstack.networkLogsOptions", networkLogsOptions);
var capabilities = {
"browserstack.networkLogs" : "true",
"browserstack.networkLogsOptions": {
"captureContent": "true"
}
}
DesiredCapabilities caps = new DesiredCapabilities();
Dictionary<string, bool> networkLogsOptions = new Dictionary<string, bool>();
networkLogsOptions.Add("captureContent", "true");
caps.SetCapability("browserstack.networkLogs", "true");
caps.SetCapability("browserstack.networkLogsOptions", networkLogsOptions);
$caps = array(
"browserstack.networkLogs" => "true",
"browserstack.networkLogsOptions" => array (
"captureContent" => "true"
)
);
"browserstack.networkLogs" : "true",
"browserstack.networkLogsOptions": {
"captureContent": "true"
}
caps = Selenium::WebDriver::Remote::Capabilities.new
networkLogsOptions = Hash.new
networkLogsOptions["captureContent"] = "true"
caps["browserstack.networkLogs"] = "true"
caps["browserstack.networkLogsOptions"] = networkLogsOptions
my $capabilities = {
"browserstack.networkLogs" => "true",
"browserstack.networkLogsOptions" => {
"captureContent" => "true"
}
}
Contact our Support team for immediate help while we work on improving our docs.
Contact our Support team for immediate help while we work on improving our docs.