How To Enter The URL In Selenium Webdriver

How to enter the url in Selenium webdriver with java
There are two way , You can enter the URL in Selenium webdriver

1) Get(“URL”);

Syntax-
WebDriver driver= new ChromeDriver();
driver.get("https://Faebook.com")


2) Navigate().to(“URL”);

Syantax-
WebDriver driver= new ChromeDriver();
driver.navigate().to("https://Facebook.com");


Selenium Code to enter the URL in selenium Webdriver (Get Method)

 1) Get();

package automationtesting;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;

public class GetMethod
 {
public static void main(String[] args
{
 System.setProperty("webdriver.chrome.driver","D:\\Sandeep\\Soft\\chromedriver.exe");
 WebDriver driver= new ChromeDriver();
  driver.get("https://facebook.com");
}
}

      
                                   
Selenium Code to enter the URL in selenium Webdriver (Navigate ().to() Method)

2) Navigate().to();

package automationtesting;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;

public class GetMethod
 {
public static void main(String[] args
{
 System.setProperty("webdriver.chrome.driver","D:\\Sandeep\\Soft\\chromedriver.exe");
 WebDriver driver= new ChromeDriver();
 driver.Navigate().to ("https://facebook.com");
}
}


Hope !!! The above code of " How To Enter the URL in Selenium Web driver Helpful for You ..
Team 
QA acharya 

Tags: Get Method in selenium webdriver , Navigate to Method in Selenium , how to enter the URL in selenium webdriver .
Related Post:

Post a Comment

0 Comments