Below is the solution to your inquiry:
In reference to your code snippet:
WebDriver driver = new FirefoxDriver();
driver.navigate().to("https://www.google.com");
It should have functioned correctly.
If you want to open a URL (assuming the URL is of type String
), you can opt for one of the following alternative methods:
Utilize the get()
method to access the URL:
WebDriver driver = new FirefoxDriver();
driver.get("https://www.google.com");
Employ the Navigation
class to instantiate a new object and navigate to the URL:
WebDriver driver = new FirefoxDriver();
Navigation sara_navigate = driver.navigate();
sara_navigate.to("https://www.google.com");
Kindly inform me if this satisfactorily addresses your query.