Gustavo Furlan
Gustavo Furlan

Reputation: 53

Disable "DevTools listening on ws://127.0.0.1..." log message in Robot Framework

I'm using the SeleniumLibrary in Robot Framework to test a web application. My test project is currently using only .robot files, with no python code in it, and I wanted to disable this ChromeDriver log message, which appears after every test case in the console log.

I'm currently using:

Here is the full log message:

DevTools listening on ws://127.0.0.1:62913/devtools/browser/569eba7c-49ea-4fa7-953a-dee9730b3157

Apparently it's possible to solve it when using python code to do it, as we have in this post. But since I'm doing everything with only Robot Framework files, I want to continue this way.

I've also read the SeleniumLibrary Documentation searching for some solution, but found nothing useful for this case.

Useful Code - Library import:

Library     SeleniumLibrary     run_on_failure=Nothing

Is there any options to disable this log message?

Upvotes: 3

Views: 6865

Answers (1)

Bence Kaulics
Bence Kaulics

Reputation: 7281

Based on the answer you have linked this is what you need:

*** Settings ***
Library    SeleniumLibrary

*** Test Cases ***
Silent Chrome
    Open Browser    https://stackoverflow.com    Chrome    options=add_experimental_option("excludeSwitches", ["enable-logging"])

From the Open Browser keyword's documentation:

The string format allows defining Selenium options methods or attributes and their arguments in Robot Framework test data. The method and attributes names are case and space sensitive and must match to the Selenium options methods and attributes names. When defining a method, it must be defined in a similar way as in python: method name, opening parenthesis, zero to many arguments and closing parenthesis. If there is a need to define multiple arguments for a single method, arguments must be separated with comma, just like in Python. Example: add_argument("--headless") or add_experimental_option("key", "value").

Upvotes: 3

Related Questions