I use Selenium on different machines to automate testing an MVC web application.
My problem is that I cannot get the base url for each machine.
I can get the current url using the following code:
IWebDriver driver = new FirefoxDriver(); string currentUrl = driver.Url;
But this does not help when I need to go to another page.
Ideally, I could just use the following to go to different pages:
driver.Navigate().GoToUrl(baseUrl+ "/Feedback"); driver.Navigate().GoToUrl(baseUrl+ "/Home");
A possible workaround that I used:
string baseUrl = currentUrl.Remove(22);
Is there a better way to do this?
source share