1

I'm testing a .Net exe web application on my local machine using Selenium web driver in Visual Studio. To view the web UI I need to open a firefox browser and connect to http://localhost:12345

When I run this code

driver.Navigate().GoToUrl("http://localhost:12345");

a browser opens but just sits blank. Then I eventually get this error in VS:

'OpenQA.Selenium.WebDriverException : Failed to start up socket within 45000 milliseconds. Attempted to connect to the following addresses: 127.0.0.1:7055'

When I run the same test using Selenium IDE Firefox opens http://localhost:12345 correctly.

How do I get Firefox to open the localhost address I provide it in my C# code?

2
  • error says different port than what you've specified(9876) Commented Apr 8, 2016 at 10:14
  • Which version of Firefox are you working with? Can you check that once the browser has the blank page that the Selenium extension is activated? Commented Apr 8, 2016 at 10:25

1 Answer 1

1

Thanks for taking the time to look at my question. I have managed to find a solution which I will post here for anyone who encounters the same problem.

In order to access localhost I used Selenium Standalone Server instead of Web Driver. These are the steps:

1- In class under [Setup] enter

public void SetupTest() { selenium = new DefaultSelenium("localhost", 4444, "*chrome", "http://localhost:12345/"); selenium.Start(); verificationErrors = new StringBuilder(); }

2- Download Selenium Standalone Server

4- Run Selenium Standalone Server using cmd java -jar selenium-server-standalone-version-number.jar

5- Run test in Visual Studio

And now it works.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.