Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hii ,


I am new on Selenium ,

I was trying to run one simple selenium class file from my vs 2012 express

I download required selenium we driver and selenium web seriver support classes from nuget pakage manager .

But when i run this console application , it just opens up firefox and not redirecting to google and types the word hello and hits enter

please suggest

below is my code

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using OpenQA.Selenium;
using OpenQA.Selenium.Firefox;

namespace SeleniumhelloWorld
{
   public class Class1
    {
         static void Main(String[] args)
        {
            IWebDriver driver = new FirefoxDriver();

            driver.Navigate().GoToUrl("http://www.google.com/");
            driver.Manage().Window.Maximize();

            IWebElement searchInput = driver.FindElement(By.Id("sb_form_q"));
            searchInput.SendKeys("Hello World");

            searchInput.SendKeys(Keys.Enter);

            driver.Close();
             
        }
    }
}


this is what I got the error

Failed to start up socket within 45000 ms. Attempted to connect to the following addresses: 127.0.0.1:7055


I am using firefox
Quote:
36.0
Posted
Updated 22-Jan-15 18:51pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900