Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 98773

If statementdoesn't compare to the required strings and doesn't work with other if altough the variable value is same as the compared string

$
0
0

Having an issue when trying to compare strings in If statement.

private String browser = XMLreader.getData("browser");

if (browser == "chrome"){
    System.out.println(browser);
} // Will not print anything

if (browser != "chrome"){
    System.out.println(browser);
} // Will print chrome 

Any idea what am I missing?

Thanks


Viewing all articles
Browse latest Browse all 98773

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>