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

org.openqa.selenium.htmlunit.remote.HtmlUnitWebElementToJsonConverter Maven / Gradle / Ivy

There is a newer version: 4.25.0
Show newest version
package org.openqa.selenium.htmlunit.remote;

import java.util.Map;

import org.openqa.selenium.htmlunit.HtmlUnitWebElement;
import org.openqa.selenium.remote.Dialect;
import org.openqa.selenium.remote.WebElementToJsonConverter;

public class HtmlUnitWebElementToJsonConverter extends WebElementToJsonConverter {
    @Override
    public Object apply(Object arg) {
        if (arg instanceof HtmlUnitWebElement) {
            return Map.of(Dialect.W3C.getEncodedElementKey(), String.valueOf(((HtmlUnitWebElement) arg).getId()));
        }
        return super.apply(arg);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy