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

org.openqa.selenium.devtools.v128.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.

The newest version!
package org.openqa.selenium.devtools.v128.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 java.util.Map;
import java.util.LinkedHashMap;
import org.openqa.selenium.json.JsonInput;

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

    /**
     * Clears the log.
     */
    public static Command clear() {
        LinkedHashMap params = new LinkedHashMap<>();
        return new Command<>("Log.clear", Map.copyOf(params));
    }

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

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

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

    /**
     * Stop violation reporting.
     */
    public static Command stopViolationsReport() {
        LinkedHashMap params = new LinkedHashMap<>();
        return new Command<>("Log.stopViolationsReport", Map.copyOf(params));
    }

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy