How to change the URL on a WebPage using Selenium WebDriver?

41 views
Skip to first unread message

javel...@gmail.com

unread,
May 6, 2018, 12:14:53 PM5/6/18
to Selenium Users
Hello Selenium WebDrivers, 

Can any one please share how I can change the URL on current tab.. ? 

Thanks,
Java lover 

Rithika Gupta

unread,
May 14, 2018, 10:33:35 PM5/14/18
to Selenium Users
Hi 
I believe you want to open a new url on the same page , if so then you can simply do 
seleniumDriver.get("Your new url..");  // this will open the new url page on the same window where you are

if you want to get the current url you can do as:
 String url = seleniumDriver.getCurrentUrl();   // this gives you the current url of the tab that you have focus on
Reply all
Reply to author
Forward
0 new messages