Слишком длинный путь исключения с FirefoxProfile - PullRequest
1 голос
/ 06 мая 2019

Запуск FirefoxDriver с FirefoxProfile приводит к Исключение : The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.

Catch: это поведение для пользователя Windows "Администратор", с более коротким именем пользователя, например" xxxxx", такого исключения не наблюдается.

Такое поведение, скорее всего, зависит от используемого профиля & https://blog.mozilla.org/addons/2019/05/04/update-regarding-add-ons-in-firefox/ - тамнекоторые аддоны установлены (+ -15), но до того, как все исправления mozilla были запущены без исключения.

Используемые версии

  • Selenium 3.141 / 4.0 alpha
  • 64-битный geckodriver 0.23 / 0.24
  • 64-битный Firefox 66.0.3 / 66.0.4
FirefoxProfile _FirefoxProfile = new FirefoxProfile(SeleniumFirefoxProfileDirectory); //"C:\\Temp\\FirefoxProfiles\\p2"
FirefoxDriverService driverService = FirefoxDriverService.CreateDefaultService();
FirefoxOptions options = new FirefoxOptions();
options.Profile = _FirefoxProfile;

IWebDriver driver = new FirefoxDriver(driverService,options,TimeSpan.FromMinutes(3));   

StackTrace

at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.Directory.InternalCreateDirectory(String fullPath, String path, Object dirSecurityObj, Boolean checkHost)
   at System.IO.DirectoryInfo.Create()
   at OpenQA.Selenium.Internal.FileUtilities.CopyDirectory(String sourceDirectory, String destinationDirectory)
   at OpenQA.Selenium.Internal.FileUtilities.CopyDirectory(String sourceDirectory, String destinationDirectory)
   at OpenQA.Selenium.Internal.FileUtilities.CopyDirectory(String sourceDirectory, String destinationDirectory)
   at OpenQA.Selenium.Internal.FileUtilities.CopyDirectory(String sourceDirectory, String destinationDirectory)
   at OpenQA.Selenium.Internal.FileUtilities.CopyDirectory(String sourceDirectory, String destinationDirectory)
   at OpenQA.Selenium.Internal.FileUtilities.CopyDirectory(String sourceDirectory, String destinationDirectory)
   at OpenQA.Selenium.Internal.FileUtilities.CopyDirectory(String sourceDirectory, String destinationDirectory)
   at OpenQA.Selenium.Firefox.FirefoxProfile.WriteToDisk()
   at OpenQA.Selenium.Firefox.FirefoxProfile.ToBase64String()
   at OpenQA.Selenium.Firefox.FirefoxOptions.GenerateFirefoxOptionsDictionary()
   at OpenQA.Selenium.Firefox.FirefoxOptions.ToCapabilities()
   at OpenQA.Selenium.Firefox.FirefoxDriver.ConvertOptionsToCapabilities(FirefoxOptions options)
   at OpenQA.Selenium.Firefox.FirefoxDriver..ctor(FirefoxDriverService service, FirefoxOptions options, TimeSpan commandTimeout)
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...