Есть отличная удаленная работа для php+codeception+jenkins+allure+docker спецов. 100% remote! Присоединиться к проекту

Помогите разобраться с проблемой запуска тестов в Firefox

firefox
webdriver
Теги: #<Tag:0x00007f7b6434b570> #<Tag:0x00007f7b6434b430>

(Eugeniylennik) #1

Пытаюсь запустить тест в FirefoxDriver, открывается окно браузера и моментально закрывается, через какое-то время в консоли появляются ошибки. Кто знает в чем проблема?
Код ошибки

org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
sic/1.0","updateURL":null,"updateKey":null,"optionsURL":null,"optionsType":null,"aboutURL":null,"icons":{"32":"icon.png","48":"icon.png"},"iconURL":null,"icon64URL":null,"defaultLocale":{"name":"Default","description":"The default theme.","creator":"Mozilla","homepageURL":null,"contributors":["Mozilla Contributors"]},"visible":true,"active":true,"userDisabled":false,"appDisabled":false,"descriptor":"/Applications/Firefox.app/Contents/Resources/browser/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}.xpi","installDate":1465093292000,"updateDate":1465093292000,"applyBackgroundUpdates":1,"skinnable":true,"size":7134,"sourceURI":null,"releaseNotesURI":null,"softDisabled":false,"foreignInstall":false,"hasBinaryComponents":false,"strictCompatibility":true,"locales":[],"targetApplications":[{"id":"{ec8030f7-c20a-464f-9b0e-13a3a9e97384}","minVersion":"47.0","maxVersion":"47.0"}],"targetPlatforms":[],"seen":true}
1465492215331	addons.xpi	DEBUG	getModTime: Recursive scan of {972ce4c6-7e08-4474-a285-3208198ce6fd}
1465492215333	DeferredSave.extensions.json	DEBUG	Save changes
1465492215333	addons.xpi	DEBUG	Updating database with changes to installed add-ons
1465492215333	addons.xpi-utils	DEBUG	Updating add-on states
1465492215336	addons.xpi-utils	DEBUG	Writing add-ons list
1465492215338	addons.xpi	DEBUG	Registering manifest for /Applications/Firefox.app/Contents/Resources/browser/features/e10srollout@mozilla.org.xpi
1465492215339	addons.xpi	DEBUG	Calling bootstrap method startup on e10srollout@mozilla.org version 1.0
1465492215340	addons.xpi	DEBUG	Registering manifest for /Applications/Firefox.app/Contents/Resources/browser/features/firefox@getpocket.com.xpi
1465492215340	addons.xpi	DEBUG	Calling bootstrap method startup on firefox@getpocket.com version 1.0.2
1465492215342	addons.xpi	DEBUG	Registering manifest for /Applications/Firefox.app/Contents/Resources/browser/features/loop@mozilla.org.xpi
1465492215343	addons.xpi	DEBUG	Calling bootstrap method startup on loop@mozilla.org version 1.3.2
1465492215420	addons.manager	DEBUG	Registering shutdown blocker for XPIProvider
1465492215420	addons.manager	DEBUG	Provider finished startup: XPIProvider
1465492215420	addons.manager	DEBUG	Starting provider: LightweightThemeManager
1465492215420	addons.manager	DEBUG	Registering shutdown blocker for LightweightThemeManager
1465492215421	addons.manager	DEBUG	Provider finished startup: LightweightThemeManager
1465492215421	addons.manager	DEBUG	Starting provider: GMPProvider
1465492215442	addons.manager	DEBUG	Registering shutdown blocker for GMPProvider
1465492215443	addons.manager	DEBUG	Provider finished startup: GMPProvider
1465492215443	addons.manager	DEBUG	Starting provider: PluginProvider
1465492215444	addons.manager	DEBUG	Registering shutdown blocker for PluginProvider
1465492215444	addons.manager	DEBUG	Provider finished startup: PluginProvider
1465492215445	addons.manager	DEBUG	Completed startup sequence
1465492217177	addons.manager	DEBUG	Starting provider: <unnamed-provider>
1465492217177	addons.manager	DEBUG	Registering shutdown blocker for <unnamed-provider>
1465492217177	addons.manager	DEBUG	Provider finished startup: <unnamed-provider>
1465492217524	DeferredSave.extensions.json	DEBUG	Write succeeded
1465492217525	addons.xpi-utils	DEBUG	XPI Database saved, setting schema version preference to 17
1465492217525	DeferredSave.extensions.json	DEBUG	Starting timer
1465492217544	addons.repository	DEBUG	No addons.json found.
1465492217545	DeferredSave.addons.json	DEBUG	Save changes
1465492217547	DeferredSave.addons.json	DEBUG	Starting timer
1465492217677	addons.manager	DEBUG	Starting provider: PreviousExperimentProvider
1465492217677	addons.manager	DEBUG	Registering shutdown blocker for PreviousExperimentProvider
1465492217677	addons.manager	DEBUG	Provider finished startup: PreviousExperimentProvider
1465492217681	DeferredSave.extensions.json	DEBUG	Starting write
1465492217684	DeferredSave.addons.json	DEBUG	Starting write
1465492217727	DeferredSave.extensions.json	DEBUG	Write succeeded
1465492217748	DeferredSave.addons.json	DEBUG	Write succeeded

	at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:112)
	at org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:271)
	at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:119)
	at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:218)
	at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:211)
	at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:207)
	at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:120)
	at testpackage.TestClass.main(TestClass.java:8)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
Exception in thread "main" org.openqa.selenium.WebDriverException: Failed to connect to binary FirefoxBinary(/Applications/Firefox.app/Contents/MacOS/firefox-bin) on port 7055; process output follows: 
sic/1.0","updateURL":null,"updateKey":null,"optionsURL":null,"optionsType":null,"aboutURL":null,"icons":{"32":"icon.png","48":"icon.png"},"iconURL":null,"icon64URL":null,"defaultLocale":{"name":"Default","description":"The default theme.","creator":"Mozilla","homepageURL":null,"contributors":["Mozilla Contributors"]},"visible":true,"active":true,"userDisabled":false,"appDisabled":false,"descriptor":"/Applications/Firefox.app/Contents/Resources/browser/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}.xpi","installDate":1465093292000,"updateDate":1465093292000,"applyBackgroundUpdates":1,"skinnable":true,"size":7134,"sourceURI":null,"releaseNotesURI":null,"softDisabled":false,"foreignInstall":false,"hasBinaryComponents":false,"strictCompatibility":true,"locales":[],"targetApplications":[{"id":"{ec8030f7-c20a-464f-9b0e-13a3a9e97384}","minVersion":"47.0","maxVersion":"47.0"}],"targetPlatforms":[],"seen":true}
1465492215331	addons.xpi	DEBUG	getModTime: Recursive scan of {972ce4c6-7e08-4474-a285-3208198ce6fd}
1465492215333	DeferredSave.extensions.json	DEBUG	Save changes
1465492215333	addons.xpi	DEBUG	Updating database with changes to installed add-ons
1465492215333	addons.xpi-utils	DEBUG	Updating add-on states
1465492215336	addons.xpi-utils	DEBUG	Writing add-ons list
1465492215338	addons.xpi	DEBUG	Registering manifest for /Applications/Firefox.app/Contents/Resources/browser/features/e10srollout@mozilla.org.xpi
1465492215339	addons.xpi	DEBUG	Calling bootstrap method startup on e10srollout@mozilla.org version 1.0
1465492215340	addons.xpi	DEBUG	Registering manifest for /Applications/Firefox.app/Contents/Resources/browser/features/firefox@getpocket.com.xpi
1465492215340	addons.xpi	DEBUG	Calling bootstrap method startup on firefox@getpocket.com version 1.0.2
1465492215342	addons.xpi	DEBUG	Registering manifest for /Applications/Firefox.app/Contents/Resources/browser/features/loop@mozilla.org.xpi
1465492215343	addons.xpi	DEBUG	Calling bootstrap method startup on loop@mozilla.org version 1.3.2
1465492215420	addons.manager	DEBUG	Registering shutdown blocker for XPIProvider
1465492215420	addons.manager	DEBUG	Provider finished startup: XPIProvider
1465492215420	addons.manager	DEBUG	Starting provider: LightweightThemeManager
1465492215420	addons.manager	DEBUG	Registering shutdown blocker for LightweightThemeManager
1465492215421	addons.manager	DEBUG	Provider finished startup: LightweightThemeManager
1465492215421	addons.manager	DEBUG	Starting provider: GMPProvider
1465492215442	addons.manager	DEBUG	Registering shutdown blocker for GMPProvider
1465492215443	addons.manager	DEBUG	Provider finished startup: GMPProvider
1465492215443	addons.manager	DEBUG	Starting provider: PluginProvider
1465492215444	addons.manager	DEBUG	Registering shutdown blocker for PluginProvider
1465492215444	addons.manager	DEBUG	Provider finished startup: PluginProvider
1465492215445	addons.manager	DEBUG	Completed startup sequence
1465492217177	addons.manager	DEBUG	Starting provider: <unnamed-provider>
1465492217177	addons.manager	DEBUG	Registering shutdown blocker for <unnamed-provider>
1465492217177	addons.manager	DEBUG	Provider finished startup: <unnamed-provider>
1465492217524	DeferredSave.extensions.json	DEBUG	Write succeeded
1465492217525	addons.xpi-utils	DEBUG	XPI Database saved, setting schema version preference to 17
1465492217525	DeferredSave.extensions.json	DEBUG	Starting timer
1465492217544	addons.repository	DEBUG	No addons.json found.
1465492217545	DeferredSave.addons.json	DEBUG	Save changes
1465492217547	DeferredSave.addons.json	DEBUG	Starting timer
1465492217677	addons.manager	DEBUG	Starting provider: PreviousExperimentProvider
1465492217677	addons.manager	DEBUG	Registering shutdown blocker for PreviousExperimentProvider
1465492217677	addons.manager	DEBUG	Provider finished startup: PreviousExperimentProvider
1465492217681	DeferredSave.extensions.json	DEBUG	Starting write
1465492217684	DeferredSave.addons.json	DEBUG	Starting write
1465492217727	DeferredSave.extensions.json	DEBUG	Write succeeded
1465492217748	DeferredSave.addons.json	DEBUG	Write succeeded

Build info: version: '2.53.0', revision: '35ae25b', time: '2016-03-15 16:57:40'
System info: host: 'MacBook-Air-Eugeniy.local', ip: '192.168.1.202', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.11.5', java.version: '1.8.0_92'
Driver info: driver.version: FirefoxDriver
	at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:124)
	at org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:271)
	at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:119)
	at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:218)
	at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:211)
	at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:207)
	at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:120)
	at testpackage.TestClass.main(TestClass.java:8)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
Caused by: org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
sic/1.0","updateURL":null,"updateKey":null,"optionsURL":null,"optionsType":null,"aboutURL":null,"icons":{"32":"icon.png","48":"icon.png"},"iconURL":null,"icon64URL":null,"defaultLocale":{"name":"Default","description":"The default theme.","creator":"Mozilla","homepageURL":null,"contributors":["Mozilla Contributors"]},"visible":true,"active":true,"userDisabled":false,"appDisabled":false,"descriptor":"/Applications/Firefox.app/Contents/Resources/browser/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}.xpi","installDate":1465093292000,"updateDate":1465093292000,"applyBackgroundUpdates":1,"skinnable":true,"size":7134,"sourceURI":null,"releaseNotesURI":null,"softDisabled":false,"foreignInstall":false,"hasBinaryComponents":false,"strictCompatibility":true,"locales":[],"targetApplications":[{"id":"{ec8030f7-c20a-464f-9b0e-13a3a9e97384}","minVersion":"47.0","maxVersion":"47.0"}],"targetPlatforms":[],"seen":true}
1465492215331	addons.xpi	DEBUG	getModTime: Recursive scan of {972ce4c6-7e08-4474-a285-3208198ce6fd}
1465492215333	DeferredSave.extensions.json	DEBUG	Save changes
1465492215333	addons.xpi	DEBUG	Updating database with changes to installed add-ons
1465492215333	addons.xpi-utils	DEBUG	Updating add-on states
1465492215336	addons.xpi-utils	DEBUG	Writing add-ons list
1465492215338	addons.xpi	DEBUG	Registering manifest for /Applications/Firefox.app/Contents/Resources/browser/features/e10srollout@mozilla.org.xpi
1465492215339	addons.xpi	DEBUG	Calling bootstrap method startup on e10srollout@mozilla.org version 1.0
1465492215340	addons.xpi	DEBUG	Registering manifest for /Applications/Firefox.app/Contents/Resources/browser/features/firefox@getpocket.com.xpi
1465492215340	addons.xpi	DEBUG	Calling bootstrap method startup on firefox@getpocket.com version 1.0.2
1465492215342	addons.xpi	DEBUG	Registering manifest for /Applications/Firefox.app/Contents/Resources/browser/features/loop@mozilla.org.xpi
1465492215343	addons.xpi	DEBUG	Calling bootstrap method startup on loop@mozilla.org version 1.3.2
1465492215420	addons.manager	DEBUG	Registering shutdown blocker for XPIProvider
1465492215420	addons.manager	DEBUG	Provider finished startup: XPIProvider
1465492215420	addons.manager	DEBUG	Starting provider: LightweightThemeManager
1465492215420	addons.manager	DEBUG	Registering shutdown blocker for LightweightThemeManager
1465492215421	addons.manager	DEBUG	Provider finished startup: LightweightThemeManager
1465492215421	addons.manager	DEBUG	Starting provider: GMPProvider
1465492215442	addons.manager	DEBUG	Registering shutdown blocker for GMPProvider
1465492215443	addons.manager	DEBUG	Provider finished startup: GMPProvider
1465492215443	addons.manager	DEBUG	Starting provider: PluginProvider
1465492215444	addons.manager	DEBUG	Registering shutdown blocker for PluginProvider
1465492215444	addons.manager	DEBUG	Provider finished startup: PluginProvider
1465492215445	addons.manager	DEBUG	Completed startup sequence
1465492217177	addons.manager	DEBUG	Starting provider: <unnamed-provider>
1465492217177	addons.manager	DEBUG	Registering shutdown blocker for <unnamed-provider>
1465492217177	addons.manager	DEBUG	Provider finished startup: <unnamed-provider>
1465492217524	DeferredSave.extensions.json	DEBUG	Write succeeded
1465492217525	addons.xpi-utils	DEBUG	XPI Database saved, setting schema version preference to 17
1465492217525	DeferredSave.extensions.json	DEBUG	Starting timer
1465492217544	addons.repository	DEBUG	No addons.json found.
1465492217545	DeferredSave.addons.json	DEBUG	Save changes
1465492217547	DeferredSave.addons.json	DEBUG	Starting timer
1465492217677	addons.manager	DEBUG	Starting provider: PreviousExperimentProvider
1465492217677	addons.manager	DEBUG	Registering shutdown blocker for PreviousExperimentProvider
1465492217677	addons.manager	DEBUG	Provider finished startup: PreviousExperimentProvider
1465492217681	DeferredSave.extensions.json	DEBUG	Starting write
1465492217684	DeferredSave.addons.json	DEBUG	Starting write
1465492217727	DeferredSave.extensions.json	DEBUG	Write succeeded
1465492217748	DeferredSave.addons.json	DEBUG	Write succeeded

	at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:112)
	... 12 more

(Bolatbek) #2

Можно подробнее: как запускаете (код запуска), где запускаете (ОС и версия), какая версия селениума, файрфокса, и т.д.


(Evgeny) #3

мне кажется сейчас у всех проблема с 47 версией FF


(Eugeniylennik) #4

Да, последняя стабильно работающая версия FF 45.0.1


(Roman Yakymchuk) #5

Попробуйте использовать Marionette driver https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/WebDriver


(Roman Yakymchuk) #6

http://selenium2.ru/news/175-firefox47.html


(Sergey Korol) #7

У всех, у кого включены автоапдейты. :slight_smile:


(Nik Sidorenko) #8

Подробнее в конце поста.


(Jamie Berry) #9

Скиньте код теста, как вы запускаете Firefox. Должно быть что-то похожее на:

public class TestClass {

@Test

public void StartWebDriver() throws InterruptedException {

    WebDriver driver = new FirefoxDriver();
    driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
    driver.navigate().to("http://example.com");

    driver.close();
    driver.quit();
  }

}


(Nik Sidorenko) #10

Так и есть. Очень похожее. Только это пример на С#, так как в теме упоминался C#, то я и экспериментировал на C# в VisualStudio. На Java выглядит так же, только имена методов с маленькой буквы :slight_smile:

    class Program
    {
        static void Main(string[] args)
        {
            var driver = new FirefoxDriver();
            driver.Navigate().GoToUrl("http://google.com");
            driver.Close();
        }
    }

У Вас такие же проблемы при запуске ФФ?