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

org.openqa.selenium.devtools.v124.deviceaccess.DeviceAccess 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.22.0
Show newest version
package org.openqa.selenium.devtools.v124.deviceaccess;

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;

@Beta()
public class DeviceAccess {

    /**
     * Enable events in this domain.
     */
    public static Command enable() {
        LinkedHashMap params = new LinkedHashMap<>();
        return new Command<>("DeviceAccess.enable", Map.copyOf(params));
    }

    /**
     * Disable events in this domain.
     */
    public static Command disable() {
        LinkedHashMap params = new LinkedHashMap<>();
        return new Command<>("DeviceAccess.disable", Map.copyOf(params));
    }

    /**
     * Select a device in response to a DeviceAccess.deviceRequestPrompted event.
     */
    public static Command selectPrompt(org.openqa.selenium.devtools.v124.deviceaccess.model.RequestId id, org.openqa.selenium.devtools.v124.deviceaccess.model.DeviceId deviceId) {
        java.util.Objects.requireNonNull(id, "id is required");
        java.util.Objects.requireNonNull(deviceId, "deviceId is required");
        LinkedHashMap params = new LinkedHashMap<>();
        params.put("id", id);
        params.put("deviceId", deviceId);
        return new Command<>("DeviceAccess.selectPrompt", Map.copyOf(params));
    }

    /**
     * Cancel a prompt in response to a DeviceAccess.deviceRequestPrompted event.
     */
    public static Command cancelPrompt(org.openqa.selenium.devtools.v124.deviceaccess.model.RequestId id) {
        java.util.Objects.requireNonNull(id, "id is required");
        LinkedHashMap params = new LinkedHashMap<>();
        params.put("id", id);
        return new Command<>("DeviceAccess.cancelPrompt", Map.copyOf(params));
    }

    public static Event deviceRequestPrompted() {
        return new Event<>("DeviceAccess.deviceRequestPrompted", input -> input.read(org.openqa.selenium.devtools.v124.deviceaccess.model.DeviceRequestPrompted.class));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy