Here is my code:
package seleniumTutorials; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.chrome.ChromeOptions; public class BasicsSelenium { public static void main(String[] args) { boolean status; status=true; boolean newstatus = false; System.out.println("My Old status was "+status); System.out.println("My new status was "+newstatus); System.setProperty("webdriver.chrome.driver", "F:\\Samraj\\MavenAutomation\\Jar Files\\Selenium Java\\chromedriver.exe"); ChromeOptions chromeOptions = new ChromeOptions(); chromeOptions.addArguments("--start-maximized"); WebDriver driver = new ChromeDriver(chromeOptions); driver.get("dev.findmyfare.io"); System.out.println(driver.getTitle()); } }
Below is the error message which am getting after declaring webdriver concept:
Exception in thread "main" java.lang.Error: Unresolved compilation problems: WebDriver cannot be resolved to a type ChromeDriver cannot be resolved to a type at seleniumTutorials.BasicsSelenium.main(BasicsSelenium.java:13)
Note: I can able to execute simple java program.
driver.get("dev.findmyfare.io")
will throw an error. Please usehttp
orhttps
before the url