Удаленка для jenkins+selenide+selenoid+allure+docker спецов на 2-3 часа в день. 100% remote! Присоединиться к проекту

Не запускается локальный chromedriver под ubuntu, проект с использоваением selenide

ubuntu
chromedriver
webdriver
selenide
selenium
Теги: #<Tag:0x00007fedb9f84ab8> #<Tag:0x00007fedb9f84978> #<Tag:0x00007fedb9f84838> #<Tag:0x00007fedb9f846f8> #<Tag:0x00007fedb9f845b8>

(Tatyana Durova) #1

Проблема (Вопрос) заключается …
При запуске на локальной машине тестов с помощью команды
clean test -Plocal -Dbrowser=chrom

Получаю ошибку:
Aug 11, 2017 1:55:19 PM com.codeborne.selenide.impl.WebDriverThreadLocalContainer getWebDriver INFO: No webdriver is bound to current thread: 12 - let's create new webdriver Tests run: 45, Failures: 1, Errors: 0, Skipped: 44, Time elapsed: 1.24 sec <<< FAILURE! - in TestSuite setUp(com.meetrics.friendly_iframes.script_inside.FriendlyIframeTest) Time elapsed: 1.121 sec <<< FAILURE! java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.chrome.driver system property; for more information, see https://github.com/SeleniumHQ/selenium/wiki/ChromeDriver. The latest version can be downloaded from http://chromedriver.storage.googleapis.com/index.html at com.google.common.base.Preconditions.checkState(Preconditions.java:738) at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:124) at org.openqa.selenium.chrome.ChromeDriverService.access$000(ChromeDriverService.java:32) at org.openqa.selenium.chrome.ChromeDriverService$Builder.findDefaultExecutable(ChromeDriverService.java:137) at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:330) at org.openqa.selenium.chrome.ChromeDriverService.createDefaultService(ChromeDriverService.java:88) at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:148) at com.codeborne.selenide.webdriver.WebDriverFactory.createChromeDriver(WebDriverFactory.java:168) at com.codeborne.selenide.webdriver.WebDriverFactory.createWebDriver(WebDriverFactory.java:48) at com.codeborne.selenide.impl.WebDriverThreadLocalContainer.createDriver(WebDriverThreadLocalContainer.java:242) at com.codeborne.selenide.impl.WebDriverThreadLocalContainer.getWebDriver(WebDriverThreadLocalContainer.java:98) at com.codeborne.selenide.WebDriverRunner.getWebDriver(WebDriverRunner.java:119) at webdriver.WebDriverFactory.getInstance(WebDriverFactory.java:86) at com.meetrics.TestNgTestBase.setUp(TestNgTestBase.java:72) 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 org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:108) at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:523) at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:224) at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:146) at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:166) at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:105) at org.testng.TestRunner.privateRun(TestRunner.java:744) at org.testng.TestRunner.run(TestRunner.java:602) at org.testng.SuiteRunner.runTest(SuiteRunner.java:380) at org.testng.SuiteRunner.access$000(SuiteRunner.java:39) at org.testng.SuiteRunner$SuiteWorker.run(SuiteRunner.java:414) at org.testng.internal.thread.ThreadUtil$1.call(ThreadUtil.java:52) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)

Использую Ubuntu и chromedriver_linux64, который положила в кастомную директорию на своей машине и добавила ее в Path с помощью команды:

$ export PATH=$PATH:$HOME/tools/webdrivers

$ chromedriver
Starting ChromeDriver 2.31.488763 (092de99f48a300323ecf8c2a4e2e7cab51de5ba8) on port 9515
Only local connections are allowed.

UPD: Сделала Path permament
~/.profile

добавив в конец фаула строку:
export PATH=$PATH:$HOME/tools/webdrivers

После этого стала ошибка изменилась на:

Aug 11, 2017 3:37:40 PM com.codeborne.selenide.impl.WebDriverThreadLocalContainer getWebDriver
INFO: No webdriver is bound to current thread: 12 - let's create new webdriver
Starting ChromeDriver 2.31.488763 (092de99f48a300323ecf8c2a4e2e7cab51de5ba8) on port 27278
Only local connections are allowed.
Starting ChromeDriver 2.31.488763 (092de99f48a300323ecf8c2a4e2e7cab51de5ba8) on port 9515
Only local connections are allowed.

(asolntsev) #2

Привет!
Концовку не понял. Вы пишите: “После этого стала ошибка изменилась на:” - но ведь там никакой ошибки нет. Нормальное сообщение о том, что Selenide открыл новый браузер. Так и должно быть.


(Tatyana Durova) #3

Не знаю, почему то я не вижу окно браузера и тесты валяться с ошибкой:

09:19:01.959  INFO   com.xxx.friendly_iframes.script_inside.FriendlyIframeTest -> Running tests on environment chrome
Aug 14, 2017 9:19:01 AM com.codeborne.selenide.impl.WebDriverThreadLocalContainer getWebDriver
INFO: No webdriver is bound to current thread: 12 - let's create new webdriver
Starting ChromeDriver 2.31.488763 (092de99f48a300323ecf8c2a4e2e7cab51de5ba8) on port 25447
Only local connections are allowed.
Starting ChromeDriver 2.31.488763 (092de99f48a300323ecf8c2a4e2e7cab51de5ba8) on port 9515
Only local connections are allowed.
Tests run: 45, Failures: 1, Errors: 0, Skipped: 44, Time elapsed: 61.32 sec <<< FAILURE! - in TestSuite
setUp(com.xxx.friendly_iframes.script_inside.FriendlyIframeTest)  Time elapsed: 61.218 sec  <<< FAILURE!
org.openqa.selenium.WebDriverException: chrome not reachable
  (Driver info: chromedriver=2.31.488763 (092de99f48a300323ecf8c2a4e2e7cab51de5ba8),platform=Linux 4.10.0-30-generic x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 60.05 seconds
Build info: version: '3.4.0', revision: 'unknown', time: 'unknown'
System info: host: 'NB0022', ip: '172.20.3.231', os.name: 'Linux', os.arch: 'amd64', os.version: '4.10.0-30-generic', java.version: '1.8.0_131'
Driver info: driver.version: ChromeDriver
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:215)
	at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:167)
	at org.openqa.selenium.remote.JsonWireProtocolResponse.lambda$new$0(JsonWireProtocolResponse.java:53)
	at org.openqa.selenium.remote.JsonWireProtocolResponse.lambda$getResponseFunction$2(JsonWireProtocolResponse.java:91)
	at org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$22(ProtocolHandshake.java:365)
	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
	at java.util.Spliterators$ArraySpliterator.tryAdvance(Spliterators.java:958)
	at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126)
	at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:498)
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485)
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
	at java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:152)
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:464)
	at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:368)
	at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:159)
	at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:142)
	at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:82)
	at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:637)
	at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:250)
	at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:236)
	at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:137)
	at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:184)
	at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:148)
	at com.codeborne.selenide.webdriver.WebDriverFactory.createChromeDriver(WebDriverFactory.java:168)
	at com.codeborne.selenide.webdriver.WebDriverFactory.createWebDriver(WebDriverFactory.java:48)
	at com.codeborne.selenide.impl.WebDriverThreadLocalContainer.createDriver(WebDriverThreadLocalContainer.java:242)
	at com.codeborne.selenide.impl.WebDriverThreadLocalContainer.getWebDriver(WebDriverThreadLocalContainer.java:98)
	at com.codeborne.selenide.WebDriverRunner.getWebDriver(WebDriverRunner.java:119)
	at webdriver.WebDriverFactory.getInstance(WebDriverFactory.java:98)
	at com.xxx.TestNgTestBase.setUp(TestNgTestBase.java:72)
	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 org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:108)
	at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:523)
	at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:224)
	at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:146)
	at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:166)
	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:105)
	at org.testng.TestRunner.privateRun(TestRunner.java:744)
	at org.testng.TestRunner.run(TestRunner.java:602)
	at org.testng.SuiteRunner.runTest(SuiteRunner.java:380)
	at org.testng.SuiteRunner.access$000(SuiteRunner.java:39)
	at org.testng.SuiteRunner$SuiteWorker.run(SuiteRunner.java:414)
	at org.testng.internal.thread.ThreadUtil$1.call(ThreadUtil.java:52)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)


Results :

Failed tests: 
  FriendlyIframeTest>TestNgTestBase.setUp:72 » WebDriver chrome not reachable


(Николай Анатольевич) #4

Может быть это вам поможет…


(Tatyana Durova) #5

Изменила путь

caps = DesiredCapabilities.chrome();

            // Add ChromeDriver-specific capabilities through ChromeOptions.
            ChromeOptions options = new ChromeOptions();

            options.setBinary("/usr/bin/google-chrome");
            caps.setCapability(ChromeOptions.CAPABILITY, options);

Хром стал открываться, но почему то помечается как dead, убивается и создается снова. С firefox таких проблем нет.

10:20:14.361  INFO   com.xxx.friendly_iframes.script_inside.FriendlyIframeTest -> Running tests on environment chrome
Aug 14, 2017 10:20:14 AM com.codeborne.selenide.impl.WebDriverThreadLocalContainer getWebDriver
INFO: No webdriver is bound to current thread: 12 - let's create new webdriver
Starting ChromeDriver 2.31.488763 (092de99f48a300323ecf8c2a4e2e7cab51de5ba8) on port 19171
Only local connections are allowed.
Aug 14, 2017 10:20:15 AM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: OSS
Aug 14, 2017 10:20:15 AM com.codeborne.selenide.webdriver.WebDriverFactory createWebDriver
INFO: BrowserName=chrome Version=60.0.3112.90 Platform=LINUX
Aug 14, 2017 10:20:15 AM com.codeborne.selenide.webdriver.WebDriverFactory createWebDriver
INFO: Selenide v. 4.5.1
Aug 14, 2017 10:20:15 AM com.codeborne.selenide.webdriver.WebDriverFactory createWebDriver
INFO: Selenium WebDriver v. 3.4.0 build time: unknown
Aug 14, 2017 10:20:15 AM com.codeborne.selenide.impl.WebDriverThreadLocalContainer createDriver
INFO: Create webdriver in current thread 12: ChromeDriver -> ChromeDriver: chrome on LINUX (3c69d379520b778d775f0e2d13f12d8d)
10:20:26.825  INFO   com.xxx.friendly_iframes.script_outside.StickyIframeTest -> Running tests on environment chrome
Aug 14, 2017 10:20:26 AM com.codeborne.selenide.impl.WebDriverThreadLocalContainer closeUnusedWebdrivers
INFO: Thread 12 is dead. Let's close webdriver ChromeDriver: chrome on LINUX (null)
Aug 14, 2017 10:20:26 AM com.codeborne.selenide.impl.WebDriverThreadLocalContainer closeWebDriver
INFO: Close webdriver: 12 -> ChromeDriver: chrome on LINUX (null)
Aug 14, 2017 10:20:26 AM com.codeborne.selenide.impl.WebDriverThreadLocalContainer$CloseBrowser run
INFO: Trying to close the browser ChromeDriver ...

Вот как это выглядит при запуске в Firefox:

Aug 14, 2017 10:24:03 AM com.codeborne.selenide.impl.WebDriverThreadLocalContainer getWebDriver
INFO: No webdriver is bound to current thread: 12 - let's create new webdriver
Aug 14, 2017 10:24:03 AM com.codeborne.selenide.webdriver.WebDriverFactory createFirefoxDriver
INFO: Firefox 48+ is currently not supported by Selenium Firefox driver. Use browser=marionette with geckodriver, when using it.
1502699044184	addons.manager	DEBUG	Application has been upgraded
1502699044199	addons.manager	DEBUG	Loaded provider scope for resource://gre/modules/addons/XPIProvider.jsm: ["XPIProvider"]
1502699044202	addons.manager	DEBUG	Loaded provider scope for resource://gre/modules/LightweightThemeManager.jsm: ["LightweightThemeManager"]
1502699044206	addons.manager	DEBUG	Loaded provider scope for resource://gre/modules/addons/GMPProvider.jsm
1502699044208	addons.manager	DEBUG	Loaded provider scope for resource://gre/modules/addons/PluginProvider.jsm
1502699044209	addons.manager	DEBUG	Starting provider: XPIProvider
1502699044209	addons.xpi	DEBUG	startup
1502699044209	addons.xpi	DEBUG	Ignoring file entry whose name is not a valid add-on ID: /tmp/anonymous364482870505946158webdriver-profile/extensions/webdriver-staging
1502699044210	addons.xpi	INFO	Mapping fxdriver@googlecode.com to /tmp/anonymous364482870505946158webdriver-profile/extensions/fxdriver@googlecode.com
1502699044210	addons.xpi	INFO	Removing all system add-on upgrades.
1502699044210	addons.xpi	INFO	SystemAddonInstallLocation directory is missing
1502699044211	addons.xpi	INFO	Mapping webcompat@mozilla.org to /usr/lib/firefox/browser/features/webcompat@mozilla.org.xpi
1502699044212	addons.xpi	INFO	Mapping screenshots@mozilla.org to /usr/lib/firefox/browser/features/screenshots@mozilla.org.xpi
1502699044212	addons.xpi	INFO	Mapping e10srollout@mozilla.org to /usr/lib/firefox/browser/features/e10srollout@mozilla.org.xpi
1502699044212	addons.xpi	INFO	Mapping firefox@getpocket.com to /usr/lib/firefox/browser/features/firefox@getpocket.com.xpi
1502699044212	addons.xpi	INFO	Mapping aushelper@mozilla.org to /usr/lib/firefox/browser/features/aushelper@mozilla.org.xpi
1502699044213	addons.xpi	INFO	Mapping langpack-en-ZA@firefox.mozilla.org to /usr/lib/firefox/browser/extensions/langpack-en-ZA@firefox.mozilla.org.xpi
1502699044213	addons.xpi	INFO	Mapping {972ce4c6-7e08-4474-a285-3208198ce6fd} to /usr/lib/firefox/browser/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}.xpi
1502699044214	addons.xpi	INFO	Mapping langpack-en-GB@firefox.mozilla.org to /usr/lib/firefox/browser/extensions/langpack-en-GB@firefox.mozilla.org.xpi
1502699044214	addons.xpi	INFO	Mapping ubufox@ubuntu.com to /usr/share/mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}/ubufox@ubuntu.com.xpi
1502699044215	addons.xpi	DEBUG	checkForChanges
1502699044215	addons.xpi	INFO	SystemAddonInstallLocation directory is missing
1502699044216	addons.xpi	DEBUG	Loaded add-on state from prefs: {}
1502699044217	addons.xpi	DEBUG	New add-on fxdriver@googlecode.com in app-profile
1502699044217	addons.xpi	DEBUG	getModTime: Recursive scan of fxdriver@googlecode.com
1502699044219	addons.xpi	DEBUG	New add-on webcompat@mozilla.org in app-system-defaults
1502699044220	addons.xpi	DEBUG	getModTime: Recursive scan of webcompat@mozilla.org
1502699044221	addons.xpi	DEBUG	New add-on screenshots@mozilla.org in app-system-defaults
1502699044221	addons.xpi	DEBUG	getModTime: Recursive scan of screenshots@mozilla.org
1502699044221	addons.xpi	DEBUG	New add-on e10srollout@mozilla.org in app-system-defaults
1502699044221	addons.xpi	DEBUG	getModTime: Recursive scan of e10srollout@mozilla.org
1502699044222	addons.xpi	DEBUG	New add-on firefox@getpocket.com in app-system-defaults
1502699044222	addons.xpi	DEBUG	getModTime: Recursive scan of firefox@getpocket.com
1502699044222	addons.xpi	DEBUG	New add-on aushelper@mozilla.org in app-system-defaults
1502699044223	addons.xpi	DEBUG	getModTime: Recursive scan of aushelper@mozilla.org
1502699044223	addons.xpi	DEBUG	New add-on langpack-en-ZA@firefox.mozilla.org in app-global
1502699044223	addons.xpi	DEBUG	getModTime: Recursive scan of langpack-en-ZA@firefox.mozilla.org
1502699044224	addons.xpi	DEBUG	New add-on {972ce4c6-7e08-4474-a285-3208198ce6fd} in app-global
1502699044224	addons.xpi	DEBUG	getModTime: Recursive scan of {972ce4c6-7e08-4474-a285-3208198ce6fd}
1502699044225	addons.xpi	DEBUG	New add-on langpack-en-GB@firefox.mozilla.org in app-global
1502699044225	addons.xpi	DEBUG	getModTime: Recursive scan of langpack-en-GB@firefox.mozilla.org
1502699044225	addons.xpi	DEBUG	New add-on ubufox@ubuntu.com in app-system-share
1502699044225	addons.xpi	DEBUG	getModTime: Recursive scan of ubufox@ubuntu.com
1502699044225	addons.xpi	DEBUG	getInstallState changed: true, state: {"app-profile":{"fxdriver@googlecode.com":{"d":"/tmp/anonymous364482870505946158webdriver-profile/extensions/fxdriver@googlecode.com","st":1502699043000,"mt":1502699043000}},"app-system-defaults":{"webcompat@mozilla.org":{"d":"/usr/lib/firefox/browser/features/webcompat@mozilla.org.xpi","st":1497273884000},"screenshots@mozilla.org":{"d":"/usr/lib/firefox/browser/features/screenshots@mozilla.org.xpi","st":1497273884000},"e10srollout@mozilla.org":{"d":"/usr/lib/firefox/browser/features/e10srollout@mozilla.org.xpi","st":1497273883000},"firefox@getpocket.com":{"d":"/usr/lib/firefox/browser/features/firefox@getpocket.com.xpi","st":1497273884000},"aushelper@mozilla.org":{"d":"/usr/lib/firefox/browser/features/aushelper@mozilla.org.xpi","st":1497273883000}},"app-global":{"langpack-en-ZA@firefox.mozilla.org":{"d":"/usr/lib/firefox/browser/extensions/langpack-en-ZA@firefox.mozilla.org.xpi","st":1497274142000},"{972ce4c6-7e08-4474-a285-3208198ce6fd}":{"d":"/usr/lib/firefox/browser/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}.xpi","st":1497273883000},"langpack-en-GB@firefox.mozilla.org":{"d":"/usr/lib/firefox/browser/extensions/langpack-en-GB@firefox.mozilla.org.xpi","st":1497274142000}},"app-system-share":{"ubufox@ubuntu.com":{"d":"/usr/share/mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}/ubufox@ubuntu.com.xpi","st":1442597402000}}}
1502699044235	addons.xpi-utils	DEBUG	Opening XPI database /tmp/anonymous364482870505946158webdriver-profile/extensions.json
1502699044237	addons.xpi-utils	DEBUG	New add-on fxdriver@googlecode.com installed in app-profile
*** Blocklist::_loadBlocklistFromFile: blocklist is disabled
1502699044255	DeferredSave.extensions.json	DEBUG	Save changes
1502699044255	addons.xpi-utils	DEBUG	New add-on webcompat@mozilla.org installed in app-system-defaults
1502699044258	DeferredSave.extensions.json	DEBUG	Starting timer
1502699044261	DeferredSave.extensions.json	DEBUG	Save changes
1502699044261	addons.xpi-utils	DEBUG	New add-on screenshots@mozilla.org installed in app-system-defaults
1502699044268	DeferredSave.extensions.json	DEBUG	Save changes
1502699044269	addons.xpi-utils	DEBUG	New add-on e10srollout@mozilla.org installed in app-system-defaults
1502699044272	DeferredSave.extensions.json	DEBUG	Save changes
1502699044273	addons.xpi-utils	DEBUG	New add-on firefox@getpocket.com installed in app-system-defaults
1502699044277	DeferredSave.extensions.json	DEBUG	Save changes
1502699044277	addons.xpi-utils	DEBUG	New add-on aushelper@mozilla.org installed in app-system-defaults
1502699044282	DeferredSave.extensions.json	DEBUG	Save changes
1502699044282	addons.xpi-utils	DEBUG	New add-on langpack-en-ZA@firefox.mozilla.org installed in app-global
1502699044290	DeferredSave.extensions.json	DEBUG	Starting write
1502699044293	DeferredSave.extensions.json	DEBUG	Save changes
1502699044293	DeferredSave.extensions.json	DEBUG	Data changed while write in progress
1502699044294	addons.xpi-utils	DEBUG	New add-on {972ce4c6-7e08-4474-a285-3208198ce6fd} installed in app-global
1502699044296	DeferredSave.extensions.json	DEBUG	Save changes
1502699044297	addons.xpi-utils	DEBUG	New add-on langpack-en-GB@firefox.mozilla.org installed in app-global
1502699044306	DeferredSave.extensions.json	DEBUG	Save changes
1502699044306	addons.xpi-utils	DEBUG	New add-on ubufox@ubuntu.com installed in app-system-share
1502699044316	addons.xpi-utils	WARN	Disabling foreign installed add-on ubufox@ubuntu.com in app-system-share
1502699044317	DeferredSave.extensions.json	DEBUG	Save changes
1502699044318	addons.manager	DEBUG	Registering startup change 'installed' for fxdriver@googlecode.com
1502699044318	addons.xpi-utils	DEBUG	Make addon app-profile:fxdriver@googlecode.com visible
1502699044321	addons.xpi	DEBUG	Add-on fxdriver@googlecode.com blocks e10s rollout.
1502699044322	DeferredSave.extensions.json	DEBUG	Save changes
1502699044322	addons.manager	DEBUG	Registering startup change 'installed' for webcompat@mozilla.org
1502699044330	addons.xpi	DEBUG	Loading bootstrap scope from /usr/lib/firefox/browser/features/webcompat@mozilla.org.xpi
1502699044334	addons.xpi	DEBUG	Calling bootstrap method install on webcompat@mozilla.org version 1.1
1502699044334	addons.xpi-utils	DEBUG	Make addon app-system-defaults:webcompat@mozilla.org visible
1502699044334	addons.xpi	DEBUG	Add-on fxdriver@googlecode.com blocks e10s rollout.
1502699044334	DeferredSave.extensions.json	DEBUG	Save changes
1502699044334	addons.manager	DEBUG	Registering startup change 'installed' for screenshots@mozilla.org
1502699044335	addons.xpi	DEBUG	Loading bootstrap scope from /usr/lib/firefox/browser/features/screenshots@mozilla.org.xpi
1502699044336	addons.xpi	DEBUG	Calling bootstrap method install on screenshots@mozilla.org version 6.6.0
1502699044336	addons.xpi-utils	DEBUG	Make addon app-system-defaults:screenshots@mozilla.org visible
1502699044337	addons.xpi	DEBUG	Add-on fxdriver@googlecode.com blocks e10s rollout.
1502699044337	DeferredSave.extensions.json	DEBUG	Save changes
1502699044337	addons.manager	DEBUG	Registering startup change 'installed' for e10srollout@mozilla.org
1502699044338	addons.xpi	DEBUG	Loading bootstrap scope from /usr/lib/firefox/browser/features/e10srollout@mozilla.org.xpi
1502699044340	addons.xpi	DEBUG	Calling bootstrap method install on e10srollout@mozilla.org version 1.50
1502699044340	addons.xpi	DEBUG	Add-on fxdriver@googlecode.com blocks e10s rollout.
1502699044340	addons.xpi	DEBUG	Add-on fxdriver@googlecode.com blocks e10s rollout.
1502699044341	addons.xpi-utils	DEBUG	Make addon app-system-defaults:e10srollout@mozilla.org visible
1502699044341	addons.xpi	DEBUG	Add-on fxdriver@googlecode.com blocks e10s rollout.
1502699044341	DeferredSave.extensions.json	DEBUG	Save changes
1502699044341	addons.manager	DEBUG	Registering startup change 'installed' for firefox@getpocket.com
1502699044342	addons.xpi	DEBUG	Loading bootstrap scope from /usr/lib/firefox/browser/features/firefox@getpocket.com.xpi
1502699044345	addons.xpi	DEBUG	Calling bootstrap method install on firefox@getpocket.com version 1.0.5
1502699044345	addons.xpi-utils	DEBUG	Make addon app-system-defaults:firefox@getpocket.com visible
1502699044345	addons.xpi	DEBUG	Add-on fxdriver@googlecode.com blocks e10s rollout.
1502699044345	DeferredSave.extensions.json	DEBUG	Save changes
1502699044346	addons.manager	DEBUG	Registering startup change 'installed' for aushelper@mozilla.org
1502699044347	addons.xpi	DEBUG	Loading bootstrap scope from /usr/lib/firefox/browser/features/aushelper@mozilla.org.xpi
1502699044350	addons.xpi	DEBUG	Calling bootstrap method install on aushelper@mozilla.org version 2.0
1502699044350	addons.xpi-utils	DEBUG	Make addon app-system-defaults:aushelper@mozilla.org visible
1502699044350	addons.xpi	DEBUG	Add-on fxdriver@googlecode.com blocks e10s rollout.
1502699044350	DeferredSave.extensions.json	DEBUG	Save changes
1502699044351	addons.manager	DEBUG	Registering startup change 'installed' for langpack-en-ZA@firefox.mozilla.org
1502699044351	addons.manager	DEBUG	Registering startup change 'installed' for langpack-en-ZA@firefox.mozilla.org
1502699044351	addons.xpi-utils	DEBUG	Make addon app-global:langpack-en-ZA@firefox.mozilla.org visible
1502699044352	addons.xpi	DEBUG	Add-on fxdriver@googlecode.com blocks e10s rollout.
1502699044352	DeferredSave.extensions.json	DEBUG	Save changes
1502699044352	addons.xpi-utils	DEBUG	Make addon app-global:{972ce4c6-7e08-4474-a285-3208198ce6fd} visible
1502699044352	addons.xpi	DEBUG	Add-on fxdriver@googlecode.com blocks e10s rollout.
1502699044352	DeferredSave.extensions.json	DEBUG	Save changes
1502699044352	addons.manager	DEBUG	Registering startup change 'installed' for langpack-en-GB@firefox.mozilla.org
1502699044352	addons.manager	DEBUG	Registering startup change 'installed' for langpack-en-GB@firefox.mozilla.org
1502699044353	addons.xpi-utils	DEBUG	Make addon app-global:langpack-en-GB@firefox.mozilla.org visible
1502699044353	addons.xpi	DEBUG	Add-on fxdriver@googlecode.com blocks e10s rollout.
1502699044353	DeferredSave.extensions.json	DEBUG	Save changes
1502699044354	addons.manager	DEBUG	Registering startup change 'installed' for ubufox@ubuntu.com
1502699044354	addons.xpi-utils	DEBUG	Make addon app-system-share:ubufox@ubuntu.com visible
1502699044354	addons.xpi	DEBUG	Add-on fxdriver@googlecode.com blocks e10s rollout.

(asolntsev) #6

В общем, это уже вопрос не к селениду, это более общая селениумовская проблема. Попробуйте почитать логи chromedriver?


(Tatyana Durova) #7

А как посмотреть из под какого пользователя я запускаю сейчас и как изменить пользователя, под которым заускать?


(Iryna Onyshchuk) #8

Привет, попробуй библиотеку WebDriverManager https://github.com/bonigarcia/webdrivermanager Просто добавь в свой pom.xml зависимость и в базовом классе засетапь драйвер так:

@BeforeClass
    public static void setUp(){
        ChromeDriverManager.getInstance().setup();
        Configuration.browser = "chrome";
    }

Не надо скачивать драйвер и прописывать к нему пасс, библиотека сама это сделает :slight_smile:


(Tatyana Durova) #9

@Iryna_Onyshchuk @asolntsev Я так понимаю что с Selenide тоже полный путь в принципе можно не указывать, и он сам делает какие то похожие вещи, что и https://github.com/bonigarcia/webdrivermanager ? Или я ошибаюсь? Тогда я не очень понимаю куда мне лучше засетапить ChromeDriverManager.getInstance().setup(), мне в тоже время и настройку capabilities и доступ к браузерстеку и настроенные сочетания окружений трогать не хочется, сейчас мой файл создания драйвера выгядит так:

public static WebDriver getInstance(String environment, String config_file) throws IOException, ParseException {
        String urlToConnect = isLocal ? GRID_HUB_LOCAL_URL : BROWSER_STACK_URL;

        if (isLocal) {
            return getWebDriver();
        }
        JSONParser parser = new JSONParser();
        JSONObject config = (JSONObject) parser.parse(new FileReader("src/test/resources/conf/" + config_file));
        JSONObject envs = (JSONObject) config.get("environments");

        WebDriver webDriver = null;
        DesiredCapabilities caps = new DesiredCapabilities();

        if (isLocal) {
            caps = getCapabilities(environment);
        }
        Map<String, String> envCapabilities = (Map<String, String>) envs.get(environment);
        Iterator it = envCapabilities.entrySet().iterator();
        while (it.hasNext()) {
            Map.Entry pair = (Map.Entry) it.next();
            caps.setCapability(pair.getKey().toString(), pair.getValue().toString());
        }
        if (!isLocal) {
            Map<String, String> commonCapabilities = (Map<String, String>) config.get("capabilities");
            it = commonCapabilities.entrySet().iterator();
            while (it.hasNext()) {
                Map.Entry pair = (Map.Entry) it.next();
                if (caps.getCapability(pair.getKey().toString()) == null) {
                    caps.setCapability(pair.getKey().toString(), pair.getValue().toString());
                }
            }
        }

        try {
            webDriver = new RemoteWebDriver(new URL(urlToConnect), caps);
        } catch (MalformedURLException e) {
            logger.catching(Level.ERROR, e);
        }
        return webDriver;
    }

(Iryna Onyshchuk) #10

Если говорить об интеграции Selenide и browserstack, то тут есть полный привер подключения https://www.browserstack.com/automate/selenide


(Tatyana Durova) #11

Да, у меня все нормально с запуском на Browserstack, локально в Хроме не хочет запускаться. Так мне надо использовать https://github.com/bonigarcia/webdrivermanager в дополнении к Selenide для локального запуска или нет и если да, то куда запихнуть вызов теста, чтобы можно было легко менять браузеры для локального запуска просто через параметры коммандной строки?


(Iryna Onyshchuk) #12

посмотри тут на конфигурации, может, тебе нехватает дополнительных настроек для локального запуска https://github.com/browserstack/selenide-browserstack


(Tatyana Durova) #13

@Iryna_Onyshchuk Пробую через связку Browsestacl+Selenide локально запускать тесты, ошибка 500

/usr/lib/jvm/java-8-openjdk-amd64/bin/java -Dmaven.multiModuleProjectDirectory=/home/xxx/repos/selenium-tests/xxx-tests -Dmaven.home=/home/xxx/.local/share/JetBrains/Toolbox/apps/IDEA-U/ch-0/172.3757.29/plugins/maven/lib/maven3 -Dclassworlds.conf=/home/xxx/.local/share/JetBrains/Toolbox/apps/IDEA-U/ch-0/172.3757.29/plugins/maven/lib/maven3/bin/m2.conf -javaagent:/home/xxx/.local/share/JetBrains/Toolbox/apps/IDEA-U/ch-0/172.3757.29/lib/idea_rt.jar=46843:/home/xxx/.local/share/JetBrains/Toolbox/apps/IDEA-U/ch-0/172.3757.29/bin -Dfile.encoding=UTF-8 -classpath /home/xxx/.local/share/JetBrains/Toolbox/apps/IDEA-U/ch-0/172.3757.29/plugins/maven/lib/maven3/boot/plexus-classworlds-2.5.2.jar org.codehaus.classworlds.Launcher -Didea.version=2017.2.2 clean test -P local
[INFO] Scanning for projects...
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for com.xxx:xxxTests:jar:4.0.0
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: io.github.bonigarcia:webdrivermanager:jar -> version 1.7.1 vs 1.7.0 @ line 95, column 17
[WARNING] 
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] 
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING] 
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building xxxTests 4.0.0
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ xxxTests ---
[INFO] Deleting /home/xxx/repos/selenium-tests/xxx-tests/target
[INFO] 
[INFO] --- maven-resources-plugin:2.7:resources (default-resources) @ xxxTests ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.3:compile (default-compile) @ xxxTests ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 9 source files to /home/xxx/repos/selenium-tests/xxx-tests/target/classes
[INFO] /home/xxx/repos/selenium-tests/xxx-tests/src/main/java/webdriver/WebDriverFactory.java: /home/xxx/repos/selenium-tests/xxx-tests/src/main/java/webdriver/WebDriverFactory.java uses unchecked or unsafe operations.
[INFO] /home/xxx/repos/selenium-tests/xxx-tests/src/main/java/webdriver/WebDriverFactory.java: Recompile with -Xlint:unchecked for details.
[INFO] 
[INFO] --- maven-resources-plugin:2.7:testResources (default-testResources) @ xxxTests ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 4 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.3:testCompile (default-testCompile) @ xxxTests ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 14 source files to /home/xxx/repos/selenium-tests/xxx-tests/target/test-classes
[INFO] /home/xxx/repos/selenium-tests/xxx-tests/src/test/java/com/xxx/TestNgTestBase.java: Some input files use unchecked or unsafe operations.
[INFO] /home/xxx/repos/selenium-tests/xxx-tests/src/test/java/com/xxx/TestNgTestBase.java: Recompile with -Xlint:unchecked for details.
[INFO] 
[INFO] --- automate-maven-plugin:0.7.2-SNAPSHOT:test-compile (default) @ xxxTests ---
[INFO] 
[INFO] --- maven-surefire-plugin:2.18.1:test (default-test) @ xxxTests ---
[INFO] Surefire report directory: /home/xxx/repos/selenium-tests/xxx-tests/target/surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running TestSuite
...
... TestNG 6.11 by Cédric Beust (cedric@beust.com)
...

15:23:05.361  INFO   com.xxx.friendly_iframes.script_inside.FriendlyIframeTest -> Running tests on environment chrome
Tests run: 45, Failures: 1, Errors: 0, Skipped: 44, Time elapsed: 1.273 sec <<< FAILURE! - in TestSuite
setUp(com.xxx.friendly_iframes.script_inside.FriendlyIframeTest)  Time elapsed: 1.123 sec  <<< FAILURE!
org.openqa.selenium.WebDriverException: Unable to parse remote response: <html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 500 Server Error</title>
</head>
<body><h2>HTTP ERROR 500</h2>
<p>Problem accessing /wd/hub/session. Reason:
<pre>    Server Error</pre></p><h3>Caused by:</h3><pre>java.io.IOException: java.lang.NoClassDefFoundError: Could not initialize class org.openqa.selenium.remote.server.NewSessionPayload
	at org.openqa.grid.web.servlet.DriverServlet.process(DriverServlet.java:135)
	at org.openqa.grid.web.servlet.DriverServlet.doPost(DriverServlet.java:68)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
	at org.seleniumhq.jetty9.servlet.ServletHolder.handle(ServletHolder.java:841)
	at org.seleniumhq.jetty9.servlet.ServletHandler.doHandle(ServletHandler.java:535)
	at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188)
	at org.seleniumhq.jetty9.server.session.SessionHandler.doHandle(SessionHandler.java:1595)
	at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188)
	at org.seleniumhq.jetty9.server.handler.ContextHandler.doHandle(ContextHandler.java:1253)
	at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextScope(ScopedHandler.java:168)
	at org.seleniumhq.jetty9.servlet.ServletHandler.doScope(ServletHandler.java:473)
	at org.seleniumhq.jetty9.server.session.SessionHandler.doScope(SessionHandler.java:1564)
	at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextScope(ScopedHandler.java:166)
	at org.seleniumhq.jetty9.server.handler.ContextHandler.doScope(ContextHandler.java:1155)
	at org.seleniumhq.jetty9.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
	at org.seleniumhq.jetty9.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
	at org.seleniumhq.jetty9.server.Server.handle(Server.java:564)
	at org.seleniumhq.jetty9.server.HttpChannel.handle(HttpChannel.java:317)
	at org.seleniumhq.jetty9.server.HttpConnection.onFillable(HttpConnection.java:251)
	at org.seleniumhq.jetty9.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)
	at org.seleniumhq.jetty9.io.FillInterest.fillable(FillInterest.java:110)
	at org.seleniumhq.jetty9.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)
	at org.seleniumhq.jetty9.util.thread.Invocable.invokePreferred(Invocable.java:128)
	at org.seleniumhq.jetty9.util.thread.Invocable$InvocableExecutor.invoke(Invocable.java:222)
	at org.seleniumhq.jetty9.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:294)
	at org.seleniumhq.jetty9.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:199)
	at org.seleniumhq.jetty9.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:672)
	at org.seleniumhq.jetty9.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:590)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.openqa.selenium.remote.server.NewSessionPayload
	at org.openqa.grid.web.servlet.handler.WebDriverRequest.extractDesiredCapability(WebDriverRequest.java:70)
	at org.openqa.grid.web.servlet.handler.SeleniumBasedRequest.&lt;init&gt;(SeleniumBasedRequest.java:102)
	at org.openqa.grid.web.servlet.handler.WebDriverRequest.&lt;init&gt;(WebDriverRequest.java:40)
	at org.openqa.grid.web.servlet.handler.WebDriverRequestFactory.createFromRequest(WebDriverRequestFactory.java:30)
	at org.openqa.grid.web.servlet.handler.SeleniumBasedRequest.createFromRequest(SeleniumBasedRequest.java:73)
	at org.openqa.grid.web.servlet.DriverServlet.process(DriverServlet.java:82)
	... 29 more
</pre>
<h3>Caused by:</h3><pre>java.lang.NoClassDefFoundError: Could not initialize class org.openqa.selenium.remote.server.NewSessionPayload
	at org.openqa.grid.web.servlet.handler.WebDriverRequest.extractDesiredCapability(WebDriverRequest.java:70)
	at org.openqa.grid.web.servlet.handler.SeleniumBasedRequest.&lt;init&gt;(SeleniumBasedRequest.java:102)
	at org.openqa.grid.web.servlet.handler.WebDriverRequest.&lt;init&gt;(WebDriverRequest.java:40)
	at org.openqa.grid.web.servlet.handler.WebDriverRequestFactory.createFromRequest(WebDriverRequestFactory.java:30)
	at org.openqa.grid.web.servlet.handler.SeleniumBasedRequest.createFromRequest(SeleniumBasedRequest.java:73)
	at org.openqa.grid.web.servlet.DriverServlet.process(DriverServlet.java:82)
	at org.openqa.grid.web.servlet.DriverServlet.doPost(DriverServlet.java:68)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
	at org.seleniumhq.jetty9.servlet.ServletHolder.handle(ServletHolder.java:841)
	at org.seleniumhq.jetty9.servlet.ServletHandler.doHandle(ServletHandler.java:535)
	at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188)
	at org.seleniumhq.jetty9.server.session.SessionHandler.doHandle(SessionHandler.java:1595)
	at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188)
	at org.seleniumhq.jetty9.server.handler.ContextHandler.doHandle(ContextHandler.java:1253)
	at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextScope(ScopedHandler.java:168)
	at org.seleniumhq.jetty9.servlet.ServletHandler.doScope(ServletHandler.java:473)
	at org.seleniumhq.jetty9.server.session.SessionHandler.doScope(SessionHandler.java:1564)
	at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextScope(ScopedHandler.java:166)
	at org.seleniumhq.jetty9.server.handler.ContextHandler.doScope(ContextHandler.java:1155)
	at org.seleniumhq.jetty9.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
	at org.seleniumhq.jetty9.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
	at org.seleniumhq.jetty9.server.Server.handle(Server.java:564)
	at org.seleniumhq.jetty9.server.HttpChannel.handle(HttpChannel.java:317)
	at org.seleniumhq.jetty9.server.HttpConnection.onFillable(HttpConnection.java:251)
	at org.seleniumhq.jetty9.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)
	at org.seleniumhq.jetty9.io.FillInterest.fillable(FillInterest.java:110)
	at org.seleniumhq.jetty9.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)
	at org.seleniumhq.jetty9.util.thread.Invocable.invokePreferred(Invocable.java:128)
	at org.seleniumhq.jetty9.util.thread.Invocable$InvocableExecutor.invoke(Invocable.java:222)
	at org.seleniumhq.jetty9.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:294)
	at org.seleniumhq.jetty9.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:199)
	at org.seleniumhq.jetty9.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:672)
	at org.seleniumhq.jetty9.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:590)
	at java.lang.Thread.run(Thread.java:748)
</pre>
<hr><a href="http://eclipse.org/jetty">Powered by Jetty:// 9.4.5.v20170502</a><hr/>

</body>
</html>

Build info: version: '3.4.0', revision: 'unknown', time: 'unknown'
System info: host: 'NB0022', ip: '172.20.3.231', os.name: 'Linux', os.arch: 'amd64', os.version: '4.10.0-32-generic', java.version: '1.8.0_131'
Driver info: driver.version: RemoteWebDriver
	at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:353)
	at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:159)
	at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:142)
	at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:637)
	at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:250)
	at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:236)
	at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:137)
	at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:174)
	at webdriver.WebDriverFactory.getInstance(WebDriverFactory.java:127)
	at com.xxx.TestNgTestBase.setUp(TestNgTestBase.java:72)
	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 org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:108)
	at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:523)
	at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:224)
	at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:146)
	at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:166)
	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:105)
	at org.testng.TestRunner.privateRun(TestRunner.java:744)
	at org.testng.TestRunner.run(TestRunner.java:602)
	at org.testng.SuiteRunner.runTest(SuiteRunner.java:380)
	at org.testng.SuiteRunner.access$000(SuiteRunner.java:39)
	at org.testng.SuiteRunner$SuiteWorker.run(SuiteRunner.java:414)
	at org.testng.internal.thread.ThreadUtil$1.call(ThreadUtil.java:52)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)


Results :

Failed tests: 
  FriendlyIframeTest>TestNgTestBase.setUp:72 » WebDriver Unable to parse remote ...

Tests run: 33, Failures: 1, Errors: 0, Skipped: 32

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.830 s
[INFO] Finished at: 2017-08-15T15:23:05+02:00
[INFO] Final Memory: 34M/472M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test (default-test) on project xxxTests: There are test failures.
[ERROR] 
[ERROR] Please refer to /home/xxx/repos/selenium-tests/xxx-tests/target/surefire-reports for the individual test results.
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

Process finished with exit code 1

(Iryna Onyshchuk) #14

Здается мне, что мавен ругается на pom.xml , где неправильно подключены зависимости


(Tatyana Durova) #15

А что конректно вы тут делаете

Configuration.browser = "chrome";

и зачем это надо использовать это в дополнении к ChromeDriverManager.getInstance().setup();?


(Iryna Onyshchuk) #16

ChromeDriverManager.getInstance().setup(); - WebdriverManager скачивает и поднимает хромдрайвер, а Configuration.browser = "chrome"; - это уже селенид поднимает сам браузер


(Tatyana Durova) #17

То есть Configuration.browser = “chrome” это вместо парамтра коммандной строки
-Dbrowser=chrome

например?

Извините за кучу вопросов и спасибо большое за помощь!


(Iryna Onyshchuk) #18

Все ок :slight_smile: Да, именно так, это эквивалент команды из кода. Вы еще можете зажать ctrl и кликнуть на Configuration в IDE, чтоб посмотреть все его параметры - это бывает оч полезно, так же появится в верхнем плавом углу Download resources - будет видна еще и документация.


(Tatyana Durova) #19

Вы имеете в виду кликнуть на слово Configuration в Configuration.browser при нажатом ctrl? У меня почему то просиходит переход в код. Download resources - вообще не поняла что такое и где должно появится, не могли бы скнинуть ссылки на мануал со скриншотами или кинуть скриншот сюда?


(Tatyana Durova) #20

@Iryna_Onyshchuk @asolntsev

Так и не могу починить, хром открывается, но почему то несколько раз и несколько раз пытается убиться

17:18:51.600  INFO   com.meetrics.friendly_iframes.script_inside.FriendlyIframeTest -> Running tests on environment chrome
[2017-08-15 17:18:52:168] [TestNG-tests-1] INFO BrowserManager - Reading https://chromedriver.storage.googleapis.com/ to seek [chromedriver]
[2017-08-15 17:18:52:699] [TestNG-tests-1] INFO BrowserManager - Latest version of [chromedriver] is 2.31
[2017-08-15 17:18:52:707] [TestNG-tests-1] INFO BrowserManager - Exporting webdriver.chrome.driver as /home/tatiana/.m2/repository/webdriver/chromedriver/linux64/2.31/chromedriver
17:18:52.709  INFO   webdriver.WebDriverFactory                                   -> Running tests in local browser chrome
Aug 15, 2017 5:18:52 PM com.codeborne.selenide.impl.WebDriverThreadLocalContainer getWebDriver
INFO: No webdriver is bound to current thread: 12 - let's create new webdriver
Starting ChromeDriver 2.31.488763 (092de99f48a300323ecf8c2a4e2e7cab51de5ba8) on port 2754
Only local connections are allowed.
Aug 15, 2017 5:18:53 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: OSS
Aug 15, 2017 5:18:53 PM com.codeborne.selenide.webdriver.WebDriverFactory createWebDriver
INFO: BrowserName=chrome Version=60.0.3112.101 Platform=LINUX
Aug 15, 2017 5:18:53 PM com.codeborne.selenide.webdriver.WebDriverFactory createWebDriver
INFO: Selenide v. 4.5.1
Aug 15, 2017 5:18:53 PM com.codeborne.selenide.webdriver.WebDriverFactory createWebDriver
INFO: Selenium WebDriver v. 3.4.0 build time: unknown
Aug 15, 2017 5:18:53 PM com.codeborne.selenide.impl.WebDriverThreadLocalContainer createDriver
INFO: Create webdriver in current thread 12: ChromeDriver -> ChromeDriver: chrome on LINUX (3bbb15d237eee3cda9a4528aeacbc845)
17:19:04.861  INFO   com.meetrics.friendly_iframes.script_outside.StickyIframeTest -> Running tests on environment chrome
[2017-08-15 17:19:04:964] [TestNG-tests-1] INFO BrowserManager - Reading https://chromedriver.storage.googleapis.com/ to seek [chromedriver]
[2017-08-15 17:19:05:410] [TestNG-tests-1] INFO BrowserManager - Latest version of [chromedriver] is 2.31
[2017-08-15 17:19:05:410] [TestNG-tests-1] INFO BrowserManager - Exporting webdriver.chrome.driver as /home/tatiana/.m2/repository/webdriver/chromedriver/linux64/2.31/chromedriver
17:19:05.411  INFO   webdriver.WebDriverFactory                                   -> Running tests in local browser chrome
Aug 15, 2017 5:19:05 PM com.codeborne.selenide.impl.WebDriverThreadLocalContainer closeUnusedWebdrivers
INFO: Thread 12 is dead. Let's close webdriver ChromeDriver: chrome on LINUX (null)
Aug 15, 2017 5:19:05 PM com.codeborne.selenide.impl.WebDriverThreadLocalContainer closeWebDriver
INFO: Close webdriver: 12 -> ChromeDriver: chrome on LINUX (null)
Aug 15, 2017 5:19:05 PM com.codeborne.selenide.impl.WebDriverThreadLocalContainer$CloseBrowser run
INFO: Trying to close the browser ChromeDriver ...
Tests run: 43, Failures: 4, Errors: 0, Skipped: 39, Time elapsed: 14.702 sec <<< FAILURE! - in TestSuite
mrIframeNotMatchingPrimeTest(com.meetrics.friendly_iframes.script_inside.FriendlyIframeTest)  Time elapsed: 4.331 sec  <<< FAILURE!
com.codeborne.selenide.ex.ElementNotFound: Element not found {#injection-script.form-control}
Expected: visible
	at sun.reflect.GeneratedConstructorAccessor16.newInstance(Unknown Source)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:215)
	at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:167)
	at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:671)
	at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:410)
	at org.openqa.selenium.remote.RemoteWebDriver.findElementByCssSelector(RemoteWebDriver.java:501)
	at org.openqa.selenium.By$ByCssSelector.findElement(By.java:430)
	at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:402)
	at com.codeborne.selenide.impl.WebElementSelector.findElement(WebElementSelector.java:28)
	at com.codeborne.selenide.impl.ElementFinder.getWebElement(ElementFinder.java:56)
	at com.codeborne.selenide.impl.WebElementSource.checkCondition(WebElementSource.java:44)
	at com.codeborne.selenide.impl.WebElementSource.findAndAssertElementIsVisible(WebElementSource.java:72)
	at com.codeborne.selenide.commands.SetValue.execute(SetValue.java:21)
	at com.codeborne.selenide.commands.Val.execute(Val.java:17)
	at com.codeborne.selenide.commands.Commands.execute(Commands.java:143)
	at com.codeborne.selenide.impl.SelenideElementProxy.dispatchAndRetry(SelenideElementProxy.java:87)
	at com.codeborne.selenide.impl.SelenideElementProxy.invoke(SelenideElementProxy.java:63)
	at com.sun.proxy.$Proxy25.val(Unknown Source)
	at pages.Page.injectScriptInTestSuite(Page.java:65)
	at com.meetrics.friendly_iframes.script_inside.FriendlyIframeTest.mrIframeNotMatchingPrimeTest(FriendlyIframeTest.java:73)

mrIframeTest(com.meetrics.friendly_iframes.script_inside.FriendlyIframeTest)  Time elapsed: 4.311 sec  <<< FAILURE!
com.codeborne.selenide.ex.ElementNotFound: Element not found {#injection-script.form-control}
Expected: visible
	at sun.reflect.GeneratedConstructorAccessor16.newInstance(Unknown Source)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:215)
	at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:167)
	at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:671)
	at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:410)
	at org.openqa.selenium.remote.RemoteWebDriver.findElementByCssSelector(RemoteWebDriver.java:501)
	at org.openqa.selenium.By$ByCssSelector.findElement(By.java:430)
	at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:402)
	at com.codeborne.selenide.impl.WebElementSelector.findElement(WebElementSelector.java:28)
	at com.codeborne.selenide.impl.ElementFinder.getWebElement(ElementFinder.java:56)
	at com.codeborne.selenide.impl.WebElementSource.checkCondition(WebElementSource.java:44)
	at com.codeborne.selenide.impl.WebElementSource.findAndAssertElementIsVisible(WebElementSource.java:72)
	at com.codeborne.selenide.commands.SetValue.execute(SetValue.java:21)
	at com.codeborne.selenide.commands.Val.execute(Val.java:17)
	at com.codeborne.selenide.commands.Commands.execute(Commands.java:143)
	at com.codeborne.selenide.impl.SelenideElementProxy.dispatchAndRetry(SelenideElementProxy.java:87)
	at com.codeborne.selenide.impl.SelenideElementProxy.invoke(SelenideElementProxy.java:63)
	at com.sun.proxy.$Proxy25.val(Unknown Source)
	at pages.Page.injectScriptInTestSuite(Page.java:65)
	at com.meetrics.friendly_iframes.script_inside.FriendlyIframeTest.mrIframeTest(FriendlyIframeTest.java:38)

setUp(com.meetrics.friendly_iframes.script_outside.StickyIframeTest)  Time elapsed: 4.988 sec  <<< FAILURE!
org.openqa.selenium.NoSuchSessionException: Session ID is null. Using WebDriver after calling quit()?
Build info: version: '3.4.0', revision: 'unknown', time: 'unknown'
System info: host: 'NB0022', ip: '172.20.3.231', os.name: 'Linux', os.arch: 'amd64', os.version: '4.10.0-32-generic', java.version: '1.8.0_131'
Driver info: driver.version: RemoteWebDriver
	at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:131)
	at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:82)
	at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:637)
	at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:694)
	at org.openqa.selenium.remote.RemoteWebDriver$RemoteWebDriverOptions$RemoteWindow.maximize(RemoteWebDriver.java:925)
	at com.meetrics.TestNgTestBase.setUp(TestNgTestBase.java:73)
	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 org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:108)
	at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:523)
	at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:224)
	at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:146)
	at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:166)
	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:105)
	at org.testng.TestRunner.privateRun(TestRunner.java:744)
	at org.testng.TestRunner.run(TestRunner.java:602)
	at org.testng.SuiteRunner.runTest(SuiteRunner.java:380)
	at org.testng.SuiteRunner.access$000(SuiteRunner.java:39)
	at org.testng.SuiteRunner$SuiteWorker.run(SuiteRunner.java:414)
	at org.testng.internal.thread.ThreadUtil$1.call(ThreadUtil.java:52)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

tearDown(com.meetrics.friendly_iframes.script_outside.StickyIframeTest)  Time elapsed: 4.99 sec  <<< FAILURE!
org.openqa.selenium.NoSuchSessionException: Session ID is null. Using WebDriver after calling quit()?
Build info: version: '3.4.0', revision: 'unknown', time: 'unknown'
System info: host: 'NB0022', ip: '172.20.3.231', os.name: 'Linux', os.arch: 'amd64', os.version: '4.10.0-32-generic', java.version: '1.8.0_131'
Driver info: driver.version: RemoteWebDriver
	at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:131)
	at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:82)
	at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:637)
	at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:694)
	at org.openqa.selenium.remote.RemoteWebDriver.close(RemoteWebDriver.java:523)
	at com.meetrics.TestNgTestBase.tearDown(TestNgTestBase.java:97)
	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 org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:108)
	at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:523)
	at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:224)
	at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:146)
	at org.testng.internal.TestMethodWorker.invokeAfterClassMethods(TestMethodWorker.java:212)
	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:112)
	at org.testng.TestRunner.privateRun(TestRunner.java:744)
	at org.testng.TestRunner.run(TestRunner.java:602)
	at org.testng.SuiteRunner.runTest(SuiteRunner.java:380)
	at org.testng.SuiteRunner.access$000(SuiteRunner.java:39)
	at org.testng.SuiteRunner$SuiteWorker.run(SuiteRunner.java:414)
	at org.testng.internal.thread.ThreadUtil$1.call(ThreadUtil.java:52)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)