get() in Selenium
In this example, we have opened the Geeks For Geeks website (link) using the get function.
Java
//Importing the Selenium libraries import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; public class selenium3 { public static void main(String[] args) { //specify the location of the driver System.setProperty( "webdriver.chrome.driver" , "C:\\Users\\Vinayak Rai\\Downloads\\chromedriver-win64\\chromedriver-win64\\chromedriver.exe" ); //Initialising the driver WebDriver driver = new ChromeDriver(); //Launch the website } } |
Output:
Difference Between get() and navigate() in Selenium
An Automation tool that lets users automate the web page and test it on various browsers is known as Selenium. Selenium helps the users to load the web page through two different functions, i.e., get and navigate. Both of these functions have their advantages as well as disadvantages. In this article, we will compare the get and navigate functions in detail.
Contact Us