In my application when sign-in, then it navigates to another page. Now I need to get that new URL using WebDriver in selenium C#.
I can't find any function to do this. I have tried driver.Url
,
driver.getLocation()
and driver.getCurrentUrl()
, but nothing is working in my C# application. So is it possible get the current URL somehow? After it gets navigated?
Yes, you can get the URL of the current page. Instantiate your driver and then get the driver's Url property.
Code snippet:
IWebDriver driver = new FirefoxDriver();
String currentURL = driver.Url;
Help from: Selenium: Find the base Url
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With