selenium webdriver - Unable to validate title of URL of a website -


i tried validate title of url, code have mentioned below show no error gave wrong output. please see code below:

public static void main(string[] args)  { webdriver driver=new firefoxdriver(); driver.get("https://www.google.com"); string c; c = driver.gettitle(); if (c!="google") system.out.println("true"); driver.close(); } 

why output true. title of url google

https://stackoverflow.com/a/513839/366348

== tests reference equality (whether same object).

.equals() tests value equality (whether logically "equal").

so correct code if (!c.equals("google"))


Comments

Popular posts from this blog

What is happening when Matlab is starting a "parallel pool"? -

php - Cannot override Laravel Spark authentication with own implementation -

Qt QGraphicsScene is not accessable from QGraphicsView (on Qt 5.6.1) -