1

I am beginner in learning selenium. My code is like this:

driver.get("http://opensource.demo.orangehrmlive.com/");
String T = driver.getTitle();
System.out.println(T); 

Instead of the actual page title, it always displays "WebDriver" as output on the console. I am using Internet Explorer as a driver. I tried with different URLs but every time same result.

2
  • You need to wait for the page to load, to confirm this theory add a sleep between your driver.get and the get title statement, or better yet add a wait for page to load before grabbing the title. – Moe Ghafari May 4 '17 at 12:14
  • that worked pefectly fine. as you said :"I think u r using Selenium in an organization where all websites are firewalled except ur organizational websites, web apps that are y u r getting WebDriver as a return value. Please try with your organizational websites web app or timesheets etc.., with gettitle()". thanks a lot – Anirudh Anirudh May 15 '17 at 13:24
1

If I am correct I think u r using Selenium in an organization where all websites are firewalled except ur organizational websites, web apps that are y u r getting WebDriver as a return value. Please try with your organizational websites web app or timesheets etc.., with gettitle(), it will definitely fetch you the title of the currently opened website.

If the issue still persists please let us know.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.