All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.openqa.selenium.devtools.v85.log.Log Maven / Gradle / Ivy

Go to download

Selenium automates browsers. That's it! What you do with that power is entirely up to you.

There is a newer version: 4.26.0
Show newest version
package org.openqa.selenium.devtools.v85.log;

import org.openqa.selenium.Beta;
import org.openqa.selenium.devtools.Command;
import org.openqa.selenium.devtools.Event;
import org.openqa.selenium.devtools.ConverterFunctions;
import com.google.common.collect.ImmutableMap;
import org.openqa.selenium.json.JsonInput;

/**
 * Provides access to log entries.
 */
public class Log {

    /**
     * Clears the log.
     */
    public static Command clear() {
        ImmutableMap.Builder params = ImmutableMap.builder();
        return new Command<>("Log.clear", params.build());
    }

    /**
     * Disables log domain, prevents further log entries from being reported to the client.
     */
    public static Command disable() {
        ImmutableMap.Builder params = ImmutableMap.builder();
        return new Command<>("Log.disable", params.build());
    }

    /**
     * Enables log domain, sends the entries collected so far to the client by means of the
     * `entryAdded` notification.
     */
    public static Command enable() {
        ImmutableMap.Builder params = ImmutableMap.builder();
        return new Command<>("Log.enable", params.build());
    }

    /**
     * start violation reporting.
     */
    public static Command startViolationsReport(java.util.List config) {
        java.util.Objects.requireNonNull(config, "config is required");
        ImmutableMap.Builder params = ImmutableMap.builder();
        params.put("config", config);
        return new Command<>("Log.startViolationsReport", params.build());
    }

    /**
     * Stop violation reporting.
     */
    public static Command stopViolationsReport() {
        ImmutableMap.Builder params = ImmutableMap.builder();
        return new Command<>("Log.stopViolationsReport", params.build());
    }

    public static Event entryAdded() {
        return new Event<>("Log.entryAdded", ConverterFunctions.map("entry", org.openqa.selenium.devtools.v85.log.model.LogEntry.class));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy