2016-06-17 14 views
0

私は「Hello、World!」にいることを指摘したいと思います。レベル、非常に制限されたコーディング能力で、私は自動テスト(現在マニュアルのみ)で進歩していると思いますが、おそらく私のセレンのwebdriverに問題が発生しました。これは私が得る問題です: これは私のコードです:OpenQA.Selenium.WebDriverException firefoxは起動しません

 using System; 
using Microsoft.VisualStudio.TestTools.UnitTesting; 
using OpenQA.Selenium; 
using OpenQA.Selenium.Firefox; 


namespace UnitTestProject2 
{ 
    [TestClass] 
    public class FirstSoftwareAuto 

    { 
     [TestMethod] 
     public void First_Software_Login() 
     { 
      IWebDriver driver = new FirefoxDriver(); 
      driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(5)); 
      driver.Navigate().GoToUrl("//companyproductwebsite"); 
      IWebElement addUser = driver.FindElement(By.Name("Username")); 
      addUser.SendKeys("//email"); 
     } 
    } 
} 

私は正直に問題が何であるかに関してはわからない、ここで私はマイクロソフトのVisual Studioの左下を取得エラーがあります:

私の会社で役立つプログラマーの一つは、接続しようとしているからだと述べましたしかし、なぜ私はインターネットに接続していないのか分かりません。

Test Name: First_Name_Login 
Test FullName: UnitTestProject2.FirstVantAuto.First_Software_Login 
Test Source: c:\users\Name\documents\visual studio 2015\Projects\UnitTestProject2\UnitTestProject2\UnitTest1.cs : line 15 
Test Outcome: Failed 
Test Duration: 0:00:49.1936095 

Result StackTrace: 
at OpenQA.Selenium.Firefox.FirefoxDriverServer.ConnectToBrowser(TimeSpan timeToWait) 
    at OpenQA.Selenium.Firefox.FirefoxDriverServer.Start() 
    at OpenQA.Selenium.Firefox.FirefoxDriverCommandExecutor.Execute(Command commandToExecute) 
    at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters) 
    at OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities desiredCapabilities) 
    at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities) 
    at OpenQA.Selenium.Firefox.FirefoxDriver..ctor(FirefoxBinary binary, FirefoxProfile profile) 
    at OpenQA.Selenium.Firefox.FirefoxDriver..ctor() 
    at UnitTestProject2.FirstSoftwareAuto.First_Software_Login() in c:\users\name\documents\visual studio 2015\Projects\UnitTestProject2\UnitTestProject2\UnitTest1.cs:line 16 
Result Message: 
Test method UnitTestProject2.FirstSoftwareAuto.First_Software_Login threw exception: 
OpenQA.Selenium.WebDriverException: Failed to start up socket within 45000 milliseconds. Attempted to connect to the following addresses: 127.0.0.1:7055 

いずれの入力も高く評価されます。

+0

firefoxバージョン47.0を使用していますか? – RemcoW

+0

はい、ただ再インストールしました。 –

+0

この質問の回答を調べてください:http://stackoverflow.com/questions/37761668/cant-open-browser-with-selenium-after-firefox-update/37765661#37765661 – RemcoW

答えて

0

marionetteを使用するようにWebDriverを交換してください。

変更IWebDriver driver = new FirefoxDriver();

var driver = new FirefoxDriver(new FirefoxOptions());

にまた、あなたは、MarionetteDriverをダウンロードwiresに実行ファイルの名前を変更し、システムパスに追加する必要があります。ドライバはダウンロードできますhere. これはすべてduplicateに記載されています。

+0

すべて完了しましたが、別のエラーが表示されています:/任意のアイデアですか? –

+0

テストメソッドUnitTestProject2.FirstSoftwareAuto.First_Software_Login例外がスローされました:System.InvalidOperationException:エンティティが見つかりません –

関連する問題