selenium.UnsupportedCommandException: the requested resource could not be found, or a request

Solution 1:

driver.close()

The driver.close() command is used to close the current browser window having focus. In case there is only one browser open then calling driver.close() quits the whole browser session.

Usability

Use driver.close() when dealing with multiple browser tabs or windows e.g. when clicking on a link that opens another tab. In this case after performing required action in the new tab, to close the tab, call the driver.close() method.

driver.quit()

The driver.quit() is used to quit the whole browser session along with all the associated browser windows, tabs and pop-ups.

Usability

Use driver.quit() when no longer want to interact with the driver object along with any associated window, tab or pop-up. Generally, it is the last statements of the automation scripts. Call driver.quit() in the @AfterClass method to close it at the end of the whole suite.

Use following code in @AfterClass

@AfterClass
public void tearDown()
{

   if (driver != null)
      driver.Quit();
    
}