lundi 17 octobre 2016

Why can't we get the text of title tag without getTitle() method

I am curious about tags inside head section especially title tag. Why can't we get text inside that tag like other tags used inside body section? As example:

driver.findElement(By.tagName("title")).getText();

I think, it's a meta tag & there will be only one of it(If I am wrong, correct me). So, selenium provides special method like getTitle()!

Aucun commentaire:

Enregistrer un commentaire