After upgrading Mac OS X to Catalina, I have been trying to execute a very basic script written in Java for Firefox in Eclipse IDE 2018.
I've installed Gecko driver already through terminal and it's placed in /usr/local/bin.
Although, I've put the path in the script, System.setProperty("webdriver.firefox.marionette","/usr/local/bin/geckodriver");
it keeps showing me errorerror that Webdriver driver = new firefoxDriver
cannot be resolved.
CODE:
package newproject;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class PG1 {
public static void main(String[] args{
System.setProperty("webdriver.firefox.marionette","/usr/local/bin/geckodriver");
WebDriver driver = new FirefoxDriver();
String baseUrl = "http://demo.test.com/test/newtours/"; String expectedTitle = "Welcome: Mercury Tours";
String actualTitle = ""; // launch Fire fox and direct it to the Base URL driver.get(baseUrl);
// get the actual value of the title
actualTitle = driver.getTitle(); (actualTitle.contentEquals(expectedTitle)){ System.out.println("Test Passed!"); }
else { System.out.println("Test Failed"); }
//close Fire fox driver.close(); } }
Any help would be appreciated !