1import org.openqa.selenium.WebDriver;2import org.openqa.selenium.chrome.ChromeDriver;3import org.openqa.selenium.chrome.ChromeOptions;4import org.openqa.selenium.devtools.DevTools;5import org.openqa.selenium.devtools.v91.virtualauthenticator.Authenticator;6import org.openqa.selenium.devtools.v91.virtualauthenticator.VirtualAuthenticator;7import org.openqa.selenium.devtools.v91.virtualauthenticator.VirtualAuthenticatorOptions;8public class VirtualAuthenticatorTest {9 public static void main(String[] args) {10 WebDriver driver = new ChromeDriver();11 DevTools devTools = ((ChromeDriver) driver).getDevTools();12 devTools.createSession();13 Authenticator authenticator = devTools.send(VirtualAuthenticator.createAuthenticator(new VirtualAuthenticatorOptions()14 .setProtocol("u2f")15 .setTransport("usb")16 .setHasResidentKey(true)17 .setHasUserVerification(true)18 .setIsUserVerified(true)));19 System.out.println(authenticator);20 }21}22Authenticator{id=1, protocol=u2f, transport=usb, hasResidentKey=true, hasUserVerification=true, isUserVerified=true}23import org.openqa.selenium.WebDriver;24import org.openqa.selenium.chrome.ChromeDriver;25import org.openqa.selenium.chrome.ChromeOptions;26import org.openqa.selenium.devtools.DevTools;27import org.openqa.selenium.devtools.v91.virtualauthenticator.Authenticator;28import org.openqa.selenium.devtools.v91.virtualauthenticator.VirtualAuthenticator;29import org.openqa.selenium.devtools.v91.virtualauthenticator.VirtualAuthenticatorOptions;30public class VirtualAuthenticatorTest {31 public static void main(String[] args) {32 WebDriver driver = new ChromeDriver();33 DevTools devTools = ((ChromeDriver) driver).getDevTools();34 devTools.createSession();35 Authenticator authenticator = devTools.send(VirtualAuthenticator.createAuthenticator(new VirtualAuthenticatorOptions()));36 System.out.println(authenticator);37 }38}39Authenticator{id=1, protocol=u2f, transport=usb, hasResidentKey=false, hasUserVerification=false, isUserVerified=false}