Selenium IWebDriver Navigate (). GoToUrl () does not enter a URL or moves to a page

I am creating a new test project and cannot come up with anything to try to solve my problem. I have another Selenium project that works as expected, and compared them to find the differences. But firstly, the main problem I am facing. In setup, I call Driver.Navigate (). GoToUrl ("www.test.com"); No exception is thrown or anything else that indicates a problem, the stream simply proceeds to the next statement, but Url is not entered into the navigation bar, and therefore it is obvious that the driver never goes to any page. The driver starts a new instance of firefox, but it remains empty.

When I compare this new project with an existing project, they seem identical for the most part. Both projects have ... \ packages \ Selenium.WebDriver.2.37.0 and ... \ packages \ Selenium.Support.2.37.0 installed using the NuGet package manager. Both projects have identical project links in the .csproj file --Working project ... .... \ packages \ Selenium.WebDriver.2.37.0 \ Lib \ net40 \ WebDriver.dll False .... \ packages \ Selenium. Support.2.37.0 \ Lib \ net40 \ WebDriver.Support.dll

- Non-working project ... .. \ packages \ Selenium.WebDriver.2.37.0 \ Lib \ net40 \ WebDriver.dll .. \ packages \ Selenium.Support.2.37.0 \ Lib \ net40 \ WebDriver.Support.dll

No project does anything. Constructor for both calls: var WebDriver = new FirefoxDriver ();

When I look at the WebDriver object, the only difference I see is the WindowsHandles property. Working draft: WindowsHandles Count = 1

Broken project: WindowsHandles {System.Collections.ObjectModel.ReadOnlyCollection}

I have no idea why they are different, but since this is the only difference that I can find, I think it is possible that the problem is, but I have no idea whether this is true or how I can fix it. I added a try / catch block around WebDriver.Navigate (). GoToUrl (), and no exception gets caught.
Both projects target the .NET 4.0 platform. Any help is greatly awarded.

+7
c # firefox selenium visual-studio-2012 webdriver
source share
4 answers

GD, of course, I realized this right after I finally broke down and decided to post to stackoverflow. The problem, as always, is stupidly simple; apparently, IWebDrivers insist on passing in a URL starting with http. As soon as I prefix my URL with this, it worked. Smh

+17
source share

Here is a simple example of how to do this:

After installation, try running the following code example:

var driver = new ChromeDriver(); var navigate = driver.Navigate(); navigate.GoToUrl("http://www.microsoft.com"); //works navigate.GoToUrl("www.microsoft.com"); //does not work 

Good luck

+2
source share

Besides

 navigate.GoToUrl("http:\\www.microsoft.com"); // "\\" instead of "//", wont work navigate.GoToUrl("http://www.microsoft.com"); // that one works perfectly. 

with a backslash instead of slates it won’t work ... I just spent about an hour realizing this.

The URL must be a slash.

+1
source share

Just concatenation at the URL "http: //" and this problem is resolved. oo I do not know why this error, but solved. Just do it!

0
source share

All Articles