How to invoke Edge browser in selenium?

To invoke the Microsoft Edge browser in Selenium, you need to use the EdgeDriver class. Here’s an example of how you can do this:

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.edge.EdgeDriver;

public class EdgeTest {
  public static void main(String[] args) {
    // Set the path to the Microsoft Edge driver
    System.setProperty("webdriver.edge.driver", "path/to/MicrosoftWebDriver.exe");

    // Create a new instance of the Edge driver
    WebDriver driver = new EdgeDriver();

    // Open a new browser window and navigate to a website
    driver.get("http://www.example.com");
  }
}

Note that you need to download and install the Microsoft WebDriver server in order to use the EdgeDriver class. You can find the download link and instructions on how to install the WebDriver server on the Selenium website.