import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
public class LoginAndSearch {
public static void main(String[] args) {
System.setProperty("webdriver.gecko.driver","C:\\Users\\puren\\Downloads\\Compressed\\geckodriver-v0.11.1-win64\\geckodriver.exe");
DesiredCapabilities capabilities=DesiredCapabilities.firefox();
capabilities.setCapability("marionette", true);
WebDriver driver = new FirefoxDriver(capabilities);
driver.get("http://www.linkedin.com");
String a = driver.getTitle();
if (a=="LinkedIn: Log In or Sign Up")
System.out.print("Pass");
else
System.out.println("Fail");
driver.close();
}
}
In this code, the "If condition" does not match with the expected result.