How to get the current URL on a page in Selenium Java

asked 1 year ago

To get the current URL of the webpage, we can use getCurrentUrl() function in the Selenium Webdriver

Example:

driver.getCurrentUrl();
System.out.println(driver.getCurrentUrl());