Issue
Why did this happen? Chrome opens but the URL does not open with the code.
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class Id {
public static void main(String[] args) {
System.setProperty("webdriver.chrome.driver", "E:\\chromedriver\\chromedriver.exe"); //open browser
WebDriver driver = new ChromeDriver();
**driver.get("google.co.in"); //open URL**
driver.findElement(By.name("q")).sendKeys("Quadkast" + Keys.ENTER);
}
}
Solution
You need to give http/https protocol along with the url in the get() method
driver.get("http://www.google.com");
or
driver.get("https://google.com");
Answered By - YaDav MaNish
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.