Selenium C#MSTest - 无法配置runsettings插件'VSTest Run Configuration'的设置

时间:2014-09-03 13:08:11

标签: firefox c#-4.0 selenium mstest

在Visual Studio 12单元测试项目中执行selenium自动化测试时出现以下错误:

------ Discover test started ------
Failed to configure settings for runsettings plugin 'VSTest Run Configuration' as it threw following exception:
'An error occurred while parsing EntityName. Line 1, position 14.'
Please contact the plugin author.
Failed to configure settings for runsettings plugin 'VSTest Run Configuration' as it threw following exception:
'An error occurred while parsing EntityName. Line 1, position 14.'
Please contact the plugin author.
--------------------------

测试方法:

[TestMethod]
public void Test_Login()
{
      IWebDriver driver = new FirefoxDriver();
      driver.Navigate().GoToUrl("https://google.co.in");
}

环境:操作系统:用于c#的Win7 64bit / FireFox 32.0 / Seleniom客户端(2.42.0)

详细信息错误:

Test Name:  Test_Login
Test FullName:  SeleniumCSharp.Login.Test_Login
Test Source:    d:\Project\R&D\Selenium\SeleniumCSharp\SeleniumCSharp\Login.cs : line 31
Test Outcome:   Failed
Test Duration:  0:00:48.1050863

Result Message: 
Test method SeleniumCSharp.Login.Test_Login threw exception: 
OpenQA.Selenium.WebDriverException: Failed to start up socket within 45000 ms. Attempted to connect to the following addresses: 127.0.0.1:7055
Result StackTrace:  
at OpenQA.Selenium.Firefox.FirefoxDriverServer.ConnectToBrowser(TimeSpan timeToWait) in c:\Projects\webdriver\dotnet\src\webdriver\Firefox\FirefoxDriverServer.cs:line 275
   at OpenQA.Selenium.Firefox.FirefoxDriverServer.Start() in c:\Projects\webdriver\dotnet\src\webdriver\Firefox\FirefoxDriverServer.cs:line 97
   at OpenQA.Selenium.Firefox.FirefoxDriverCommandExecutor.Execute(Command commandToExecute) in c:\Projects\webdriver\dotnet\src\webdriver\Firefox\FirefoxDriverCommandExecutor.cs:line 58
   at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters) in c:\Projects\webdriver\dotnet\src\webdriver\Remote\RemoteWebDriver.cs:line 852
   at OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities desiredCapabilities) in c:\Projects\webdriver\dotnet\src\webdriver\Remote\RemoteWebDriver.cs:line 830
   at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities) in c:\Projects\webdriver\dotnet\src\webdriver\Remote\RemoteWebDriver.cs:line 89
   at OpenQA.Selenium.Firefox.FirefoxDriver..ctor(FirefoxBinary binary, FirefoxProfile profile) in c:\Projects\webdriver\dotnet\src\webdriver\Firefox\FirefoxDriver.cs:line 151
   at OpenQA.Selenium.Firefox.FirefoxDriver..ctor() in c:\Projects\webdriver\dotnet\src\webdriver\Firefox\FirefoxDriver.cs:line 119
   at SeleniumCSharp.Login.Test_Login() in d:\Project\R&D\Selenium\SeleniumCSharp\SeleniumCSharp\Login.cs:line 32

注意:当我第一次执行测试方法时,它已成功执行。但对于 所有后续执行都会引发错误。

请帮我解决此问题。

1 个答案:

答案 0 :(得分:1)

我发现其中一个父文件夹的标题中有&符号(&),这导致了错误...虽然这是一个无用的错误消息?我想一个XML解析器必须对目录路径做一些事情并导致解析错误