Kate2017pro / BRS_Test_main

BSD 3-Clause "New" or "Revised" License
0 stars 1 forks source link

Запуск под Linux #4

Open czen opened 5 years ago

czen commented 5 years ago

При запуске под Ubuntu 16.04 с установленными Chrome и Chromedreiver наблюдаются ошибки:

[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building BRSWebDriverTest 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:3.0.0:clean (default-clean) @ BRSWebDriverTest ---
[INFO] Deleting /projects/BRS_Test_main/target
[INFO] 
[INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) @ BRSWebDriverTest ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /projects/BRS_Test_main/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.7.0:compile (default-compile) @ BRSWebDriverTest ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 16 source files to /projects/BRS_Test_main/target/classes
[INFO] 
[INFO] --- maven-resources-plugin:3.0.2:testResources (default-testResources) @ BRSWebDriverTest ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /projects/BRS_Test_main/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.7.0:testCompile (default-testCompile) @ BRSWebDriverTest ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 4 source files to /projects/BRS_Test_main/target/test-classes
[INFO] 
[INFO] --- maven-surefire-plugin:2.20.1:test (default-test) @ BRSWebDriverTest ---
[INFO] 
[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] Running TestSuite
[ERROR] Tests run: 15, Failures: 8, Errors: 0, Skipped: 7, Time elapsed: 14.874 s <<< FAILURE! - in TestSuite
[ERROR] getDriver(ufy.mmcs.brs.StudentPageTest.StudentBtnTest)  Time elapsed: 3.181 s  <<< FAILURE!
org.openqa.selenium.WebDriverException: 
unknown error: cannot determine loading status
from unknown error: missing or invalid 'entry.level'
  (Session info: chrome=74.0.3729.131)
  (Driver info: chromedriver=2.24.417424 (c5c5ea873213ee72e3d0929b47482681555340c3),platform=Linux 3.10.0-957.10.1.el7.x86_64 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 0 milliseconds
Build info: version: '3.13.0', revision: '2f0d292', time: '2018-06-25T15:24:21.231Z'
System info: host: '2478776228c8', ip: '10.0.104.2', os.name: 'Linux', os.arch: 'amd64', os.version: '3.10.0-957.10.1.el7.x86_64', java.version: '1.8.0_131'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities {acceptSslCerts: true, applicationCacheEnabled: false, browserConnectionEnabled: false, browserName: chrome, chrome: {chromedriverVersion: 2.24.417424 (c5c5ea873213ee..., userDataDir: /tmp/.org.chromium.Chromium...}, cssSelectorsEnabled: true, databaseEnabled: false, handlesAlerts: true, hasTouchScreen: false, javascriptEnabled: true, locationContextEnabled: true, mobileEmulationEnabled: false, nativeEvents: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: LINUX, platformName: LINUX, rotatable: false, takesHeapSnapshot: true, takesScreenshot: true, version: 74.0.3729.131, webStorageEnabled: true}
Session ID: bdcea7d40fcd0999b6ad70a74070c307
    at ufy.mmcs.brs.StudentPageTest.StudentBtnTest.getDriver(StudentBtnTest.java:31)

[ERROR] getDriver(ufy.mmcs.brs.StudentPageTest.StudentLinkTest)  Time elapsed: 2.037 s  <<< FAILURE!
org.openqa.selenium.WebDriverException: 
unknown error: missing or invalid 'entry.level'
  (Session info: chrome=74.0.3729.131)
  (Driver info: chromedriver=2.24.417424 (c5c5ea873213ee72e3d0929b47482681555340c3),platform=Linux 3.10.0-957.10.1.el7.x86_64 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 0 milliseconds
Build info: version: '3.13.0', revision: '2f0d292', time: '2018-06-25T15:24:21.231Z'
System info: host: '2478776228c8', ip: '10.0.104.2', os.name: 'Linux', os.arch: 'amd64', os.version: '3.10.0-957.10.1.el7.x86_64', java.version: '1.8.0_131'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities {acceptSslCerts: true, applicationCacheEnabled: false, browserConnectionEnabled: false, browserName: chrome, chrome: {chromedriverVersion: 2.24.417424 (c5c5ea873213ee..., userDataDir: /tmp/.org.chromium.Chromium...}, cssSelectorsEnabled: true, databaseEnabled: false, handlesAlerts: true, hasTouchScreen: false, javascriptEnabled: true, locationContextEnabled: true, mobileEmulationEnabled: false, nativeEvents: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: LINUX, platformName: LINUX, rotatable: false, takesHeapSnapshot: true, takesScreenshot: true, version: 74.0.3729.131, webStorageEnabled: true}
Session ID: c75d48572e91731e730219f342eb89e0
    at ufy.mmcs.brs.StudentPageTest.StudentLinkTest.getDriver(StudentLinkTest.java:27)

[ERROR] with_input_into_form(ufy.mmcs.brs.InputFormTest.FormTest)  Time elapsed: 1.222 s  <<< FAILURE!
org.openqa.selenium.WebDriverException: 
unknown error: cannot determine loading status
from unknown error: missing or invalid 'entry.level'
  (Session info: chrome=74.0.3729.131)
  (Driver info: chromedriver=2.24.417424 (c5c5ea873213ee72e3d0929b47482681555340c3),platform=Linux 3.10.0-957.10.1.el7.x86_64 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 0 milliseconds
Build info: version: '3.13.0', revision: '2f0d292', time: '2018-06-25T15:24:21.231Z'
System info: host: '2478776228c8', ip: '10.0.104.2', os.name: 'Linux', os.arch: 'amd64', os.version: '3.10.0-957.10.1.el7.x86_64', java.version: '1.8.0_131'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities {acceptSslCerts: true, applicationCacheEnabled: false, browserConnectionEnabled: false, browserName: chrome, chrome: {chromedriverVersion: 2.24.417424 (c5c5ea873213ee..., userDataDir: /tmp/.org.chromium.Chromium...}, cssSelectorsEnabled: true, databaseEnabled: false, handlesAlerts: true, hasTouchScreen: false, javascriptEnabled: true, locationContextEnabled: true, mobileEmulationEnabled: false, nativeEvents: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: LINUX, platformName: LINUX, rotatable: false, takesHeapSnapshot: true, takesScreenshot: true, version: 74.0.3729.131, webStorageEnabled: true}
Session ID: 1c376e3c814db035192e7f16e64c9810
    at ufy.mmcs.brs.InputFormTest.FormTest.with_input_into_form(FormTest.java:37)

[ERROR] with_wrong_into_form(ufy.mmcs.brs.InputFormTest.FormTest)  Time elapsed: 0.034 s  <<< FAILURE!
org.openqa.selenium.WebDriverException: 
java.io.IOException: unexpected end of stream on Connection{localhost:29125, proxy=DIRECT hostAddress=localhost/127.0.0.1:29125 cipherSuite=none protocol=http/1.1}
Build info: version: '3.13.0', revision: '2f0d292', time: '2018-06-25T15:24:21.231Z'
System info: host: '2478776228c8', ip: '10.0.104.2', os.name: 'Linux', os.arch: 'amd64', os.version: '3.10.0-957.10.1.el7.x86_64', java.version: '1.8.0_131'
Driver info: driver.version: RemoteWebDriver
    at ufy.mmcs.brs.InputFormTest.FormTest.with_wrong_into_form(FormTest.java:96)
Caused by: java.io.IOException: unexpected end of stream on Connection{localhost:29125, proxy=DIRECT hostAddress=localhost/127.0.0.1:29125 cipherSuite=none protocol=http/1.1}
    at ufy.mmcs.brs.InputFormTest.FormTest.with_wrong_into_form(FormTest.java:96)
Caused by: java.io.EOFException: \n not found: limit=0 content=…
    at ufy.mmcs.brs.InputFormTest.FormTest.with_wrong_into_form(FormTest.java:96)

[ERROR] without_login_into_form(ufy.mmcs.brs.InputFormTest.FormTest)  Time elapsed: 0.011 s  <<< FAILURE!
org.openqa.selenium.WebDriverException: 
java.net.ConnectException: Failed to connect to localhost/127.0.0.1:29125
Build info: version: '3.13.0', revision: '2f0d292', time: '2018-06-25T15:24:21.231Z'
System info: host: '2478776228c8', ip: '10.0.104.2', os.name: 'Linux', os.arch: 'amd64', os.version: '3.10.0-957.10.1.el7.x86_64', java.version: '1.8.0_131'
Driver info: driver.version: RemoteWebDriver
    at ufy.mmcs.brs.InputFormTest.FormTest.without_login_into_form(FormTest.java:81)
Caused by: java.net.ConnectException: Failed to connect to localhost/127.0.0.1:29125
    at ufy.mmcs.brs.InputFormTest.FormTest.without_login_into_form(FormTest.java:81)
Caused by: java.net.ConnectException: Connection refused (Connection refused)
    at ufy.mmcs.brs.InputFormTest.FormTest.without_login_into_form(FormTest.java:81)

[ERROR] without_login_pswd_into_form(ufy.mmcs.brs.InputFormTest.FormTest)  Time elapsed: 0.007 s  <<< FAILURE!
org.openqa.selenium.WebDriverException: 
java.net.ConnectException: Failed to connect to localhost/127.0.0.1:29125
Build info: version: '3.13.0', revision: '2f0d292', time: '2018-06-25T15:24:21.231Z'
System info: host: '2478776228c8', ip: '10.0.104.2', os.name: 'Linux', os.arch: 'amd64', os.version: '3.10.0-957.10.1.el7.x86_64', java.version: '1.8.0_131'
Driver info: driver.version: RemoteWebDriver
    at ufy.mmcs.brs.InputFormTest.FormTest.without_login_pswd_into_form(FormTest.java:52)
Caused by: java.net.ConnectException: Failed to connect to localhost/127.0.0.1:29125
    at ufy.mmcs.brs.InputFormTest.FormTest.without_login_pswd_into_form(FormTest.java:52)
Caused by: java.net.ConnectException: Connection refused (Connection refused)
    at ufy.mmcs.brs.InputFormTest.FormTest.without_login_pswd_into_form(FormTest.java:52)

[ERROR] without_pswd_into_form(ufy.mmcs.brs.InputFormTest.FormTest)  Time elapsed: 0.009 s  <<< FAILURE!
org.openqa.selenium.WebDriverException: 
java.net.ConnectException: Failed to connect to localhost/127.0.0.1:29125
Build info: version: '3.13.0', revision: '2f0d292', time: '2018-06-25T15:24:21.231Z'
System info: host: '2478776228c8', ip: '10.0.104.2', os.name: 'Linux', os.arch: 'amd64', os.version: '3.10.0-957.10.1.el7.x86_64', java.version: '1.8.0_131'
Driver info: driver.version: RemoteWebDriver
    at ufy.mmcs.brs.InputFormTest.FormTest.without_pswd_into_form(FormTest.java:66)
Caused by: java.net.ConnectException: Failed to connect to localhost/127.0.0.1:29125
    at ufy.mmcs.brs.InputFormTest.FormTest.without_pswd_into_form(FormTest.java:66)
Caused by: java.net.ConnectException: Connection refused (Connection refused)
    at ufy.mmcs.brs.InputFormTest.FormTest.without_pswd_into_form(FormTest.java:66)

[ERROR] tearDown(ufy.mmcs.brs.InputFormTest.FormTest)  Time elapsed: 7.037 s  <<< FAILURE!
org.openqa.selenium.WebDriverException: 
java.net.ConnectException: Failed to connect to localhost/127.0.0.1:29125
Build info: version: '3.13.0', revision: '2f0d292', time: '2018-06-25T15:24:21.231Z'
System info: host: '2478776228c8', ip: '10.0.104.2', os.name: 'Linux', os.arch: 'amd64', os.version: '3.10.0-957.10.1.el7.x86_64', java.version: '1.8.0_131'
Driver info: driver.version: RemoteWebDriver
    at ufy.mmcs.brs.InputFormTest.FormTest.tearDown(FormTest.java:112)
Caused by: java.net.ConnectException: Failed to connect to localhost/127.0.0.1:29125
    at ufy.mmcs.brs.InputFormTest.FormTest.tearDown(FormTest.java:112)
Caused by: java.net.ConnectException: Connection refused (Connection refused)
    at ufy.mmcs.brs.InputFormTest.FormTest.tearDown(FormTest.java:112)

[INFO] 
[INFO] Results:
[INFO] 
[ERROR] Failures: 
[ERROR]   FormTest.tearDown:112 » WebDriver java.net.ConnectException: Failed to connect...
[ERROR]   FormTest.with_input_into_form:37 » WebDriver unknown error: cannot determine l...
[ERROR]   FormTest.with_wrong_into_form:96 » WebDriver java.io.IOException: unexpected e...
[ERROR]   FormTest.without_login_into_form:81 » WebDriver java.net.ConnectException: Fai...
[ERROR]   FormTest.without_login_pswd_into_form:52 » WebDriver java.net.ConnectException...
[ERROR]   FormTest.without_pswd_into_form:66 » WebDriver java.net.ConnectException: Fail...
[ERROR]   StudentBtnTest.getDriver:31 » WebDriver unknown error: cannot determine loadin...
[ERROR]   StudentLinkTest.getDriver:27 » WebDriver unknown error: missing or invalid 'en...
[INFO] 
[ERROR] Tests run: 15, Failures: 8, Errors: 0, Skipped: 7
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 19.637 s
[INFO] Finished at: 2019-05-02T16:47:42+00:00
[INFO] Final Memory: 14M/256M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.20.1:test (default-test) on project BRSWebDriverTest: There are test failures.
[ERROR] 
[ERROR] Please refer to /projects/BRS_Test_main/target/surefire-reports for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date]-jvmRun[N].dump, [date].dumpstream and [date]-jvmRun[N].dumpstream.
[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

Какой компонент не может подключиться к какому именно? Из каких составляющих состоит запуск теста, в чьих настройках следует искать ошибку?

czen commented 5 years ago

@Kate2017pro

Kate2017pro commented 5 years ago

Все это упало вполне ожидаемо. driver.findElement(By.id("grade")).click(); Виновато скорее всего это. //На самом ресурсе чтобы залогиниться под логином следует перейти по этой ссылке, а на тестовом сервере сразу открывается нужная страница и этого элемента просто нет. В новой версии тестов этот переход учтен. Он сейчас запускает тесты из test, а я стала писать их в main (так было нужно для одного эксперимента по запускам). Да и файл xml не поправила, мне оно было не срочно нужно. На этой неделе (четверг примерно) исправлю файл и внесу изменения в классы из папки test.

czen commented 5 years ago

теперь запускаем по-другому:

`docker run -it --rm --name BRS_Test_main -v "$(pwd)":/usr/src/mymaven -w /usr/src/mymaven maven:3.3-jdk-8 mvn clean install`

но при этом оно не работает:

[INFO] Running TestSuite
May 25, 2019 5:22:52 PM org.openqa.selenium.remote.DesiredCapabilities chrome
INFO: Using `new ChromeOptions()` is preferred to `DesiredCapabilities.chrome()`
May 25, 2019 5:24:53 PM org.openqa.selenium.remote.DesiredCapabilities chrome
INFO: Using `new ChromeOptions()` is preferred to `DesiredCapabilities.chrome()`
May 25, 2019 5:26:53 PM org.openqa.selenium.remote.DesiredCapabilities chrome
INFO: Using `new ChromeOptions()` is preferred to `DesiredCapabilities.chrome()`
May 25, 2019 5:28:53 PM org.openqa.selenium.remote.DesiredCapabilities chrome
INFO: Using `new ChromeOptions()` is preferred to `DesiredCapabilities.chrome()`
May 25, 2019 5:30:53 PM org.openqa.selenium.remote.DesiredCapabilities chrome
INFO: Using `new ChromeOptions()` is preferred to `DesiredCapabilities.chrome()`
May 25, 2019 5:32:53 PM org.openqa.selenium.remote.DesiredCapabilities chrome
INFO: Using `new ChromeOptions()` is preferred to `DesiredCapabilities.chrome()`
May 25, 2019 5:34:54 PM org.openqa.selenium.remote.DesiredCapabilities chrome
INFO: Using `new ChromeOptions()` is preferred to `DesiredCapabilities.chrome()`

хотя selenium-chrome-standalone доступен и другие тесты с ним работают. может, можно как-то отладить, что тесты пытаются делать и какой адрес не могут открыть?

Kate2017pro commented 5 years ago

Данное сообщение не являются ошибкой. Мне подобное тоже вываливались. При этом все работало. Можно разрешить, заменив вызов DesiredCapabilities.chrome() +свойства на :


                capability.setCapability(CapabilityType.BROWSER_NAME,"chrome");
                capability.setCapability(CapabilityType.PLATFORM_NAME,"LINUX");```
Это все сообщения или есть еще что-то? 
czen commented 5 years ago

тут проблема в том, что эти сообщения добавляются раз в пару минут после запуска и тесты никогда не завершаются. Что-то или зависло, или куда-то не подключается, но только при запуске в том контейнере

Kate2017pro commented 5 years ago

Изменение я закоммитила, но поймать и посмотреть то, что не воспроизводится - сложно. Эти сообщения будут вываливаться при каждом запуске класса, их и должно быть много. Не представляю в чем может быть ошибка, можно попытаться запустить в контейнере один класс и смотреть в самом браузере, что там происходит