vmi / selenese-runner-java

Selenium IDE native format (selenese and side) interpreter.
Other
140 stars 83 forks source link

While can't work in some situations #304

Closed JackJiaJJ closed 5 years ago

JackJiaJJ commented 5 years ago

While can't work in some situations.

Firefox 60.8.0 ESR selenese-runner: 3.24.1 geckodriver : 0.23.0 selenium: 3.14.59

My script:

abdtest.side.zip

This script can work well on IDE 3.12.1

I got below error when I run it on selenese:

[2019-07-22 23:15:28.874 -07:00] [ERROR] Command#6: open("${img}") => [Error: IllegalArgumentException - Expected scheme name at index 0: : (URI.create(URI.java:852) / URI.resolve(URI.java:1036) / Open.executeImpl(Open.java:32) / AbstractCommand.execute(AbstractCommand.java:185) / CommandList.doCommand(CommandList.java:109) / ScreenshotInterceptor.invoke(ScreenshotInterceptor.java:18) / AbstractDoCommandInterceptor.invoke(AbstractDoCommandInterceptor.java:29) / HighlightInterceptor.invoke(HighlightInterceptor.java:29) / AbstractDoCommandInterceptor.invoke(AbstractDoCommandInterceptor.java:29) / CommandLogInterceptor.invoke(CommandLogInterceptor.java:78) / AbstractDoCommandInterceptor.invoke(AbstractDoCommandInterceptor.java:29) / MaxTimeInterruptInterceptor.invoke(MaxTimeInterruptInterceptor.java:26) / AbstractDoCommandInterceptor.invoke(AbstractDoCommandInterceptor.java:29) / CommandList.execute(CommandList.java:155) / TestCase.execute(TestCase.java:235) / ExecuteTestCaseInterceptor.invoke(ExecuteTestCaseInterceptor.java:53) / AbstractExecuteTestCaseInterceptor.invoke(AbstractExecuteTestCaseInterceptor.java:29) / TestSuite.execute(TestSuite.java:185) / ExecuteTestSuiteInterceptor.invoke(ExecuteTestSuiteInterceptor.java:49) / AbstractExecuteTestSuiteInterceptor.invoke(AbstractExecuteTestSuiteInterceptor.java:29) / TestSuite.execute(TestSuite.java:185) / ExecuteTestSuiteInterceptor.invoke(ExecuteTestSuiteInterceptor.java:49) / AbstractExecuteTestSuiteInterceptor.invoke(AbstractExecuteTestSuiteInterceptor.java:29) / Runner.execute(Runner.java:791) / Runner.run(Runner.java:838) / Main.run(Main.java:97) / Main.main(Main.java:292))] [2019-07-22 23:15:28.875 -07:00] [ERROR] - Cookie: atuvc=[6%7C30] (domain=kva.se, path=/, expire=2020-08-22 23:15:23 -07:00) [2019-07-22 23:15:28.875 -07:00] [ERROR] - Cookie: atuvs=[5d36a5db0ee9a124005] (domain=kva.se, path=/, expire=2019-07-22 23:45:23 -07:00) [2019-07-22 23:15:28.875 -07:00] [ERROR] - Cookie: _ga=[GA1.2.92145241.1563862493] (domain=.kva.se, path=/, expire=2021-07-21 23:15:25 -07:00) [2019-07-22 23:15:28.875 -07:00] [ERROR] - Cookie: _gat=[1] (domain=.kva.se, path=/, expire=2019-07-22 23:15:52 -07:00) [2019-07-22 23:15:28.875 -07:00] [ERROR] - Cookie: _gid=[GA1.2.64959102.1563862493] (domain=.kva.se, path=/, expire=2019-07-23 23:15:25 -07:00) [2019-07-22 23:15:28.875 -07:00] [ERROR] - Cookie: language=[sv] (domain=kva.se, path=/, expire=) [2019-07-22 23:15:28.876 -07:00] [ERROR] - Cookie: wrongurl=[/s] (domain=kva.se, path=/, expire=) [2019-07-22 23:15:28.883 -07:00] [INFO] End(39.112sec): TestCase[abdtest] (/root/abdtest.side) [2019-07-22 23:15:28.884 -07:00] [INFO] End(0.000sec): TestSuite[Default Suite] (/root/abdtest.side) [2019-07-22 23:15:28.884 -07:00] [INFO] End(0.000sec): TestProject[loop] (/root/abdtest.side) console.log: Accessibility service init or shutdown observer does not exist. [Parent 5181, Gecko_IOThread] WARNING: pipe error (90): Connection reset by peer: file /builds/worker/workspace/build/src/ipc/chromium/src/chrome/common/ipc_channel_posix.cc, line 342 *** UTM:SVC TimerManager:registerTimer called after profile-before-change notification. Ignoring timer registration for id: telemetry_modules_ping [2019-07-22 23:15:29.734 -07:00] [INFO] Quit: FirefoxDriver [2019-07-22 23:15:29.734 -07:00] [INFO] Exit code: 3 (ERROR)

vmi commented 5 years ago

Hi,

I fixed the problem at 3.25.0. Please test it.

JackJiaJJ commented 5 years ago

It can work well with 3.25.0

[root@apm-agent-0021 selenese-3.25.0]# java -jar selenese-runner.jar --driver firefox /root/abdtest.side [2019-07-29 00:56:46.819 -07:00] [INFO] Start: Selenese Runner 3.25.0 [2019-07-29 00:56:47.283 -07:00] [INFO] No capabilities. Failed to open connection to "session" message bus: /usr/bin/dbus-launch terminated abnormally without any error message 1564387007852 mozrunner::runner INFO Running command: "/usr/bin/firefox" "-marionette" "-foreground" "-no-remote" "-profile" "/tmp/rust_mozprofile.TtyuLwi9JWaO" Failed to open connection to "session" message bus: /usr/bin/dbus-launch terminated abnormally without any error message Running without a11y support! Gtk-Message: 00:56:48.030: Failed to load module "canberra-gtk-module" Gtk-Message: 00:56:48.030: Failed to load module "pk-gtk-module" Gtk-Message: 00:56:48.035: Failed to load module "canberra-gtk-module" Gtk-Message: 00:56:48.036: Failed to load module "pk-gtk-module" 1564387008246 addons.xpi WARN Can't get modified time of /usr/lib64/firefox/browser/features/aushelper@mozilla.org.xpi 1564387008468 addons.xpi-utils WARN addMetadata: Add-on aushelper@mozilla.org is invalid: [Exception... "Component returned failure code: 0x80520006 (NS_ERROR_FILE_TARGET_DOES_NOT_EXIST) [nsIFile.isFile]" nsresult: "0x80520006 (NS_ERROR_FILE_TARGET_DOES_NOT_EXIST)" location: "JS frame :: resource://gre/modules/addons/XPIInstall.jsm :: loadManifestFromFile :: line 925" data: no] Stack trace: loadManifestFromFile()@resource://gre/modules/addons/XPIInstall.jsm:925 syncLoadManifestFromFile()@resource://gre/modules/addons/XPIProvider.jsm:940 addMetadata()@resource://gre/modules/addons/XPIProvider.jsm -> resource://gre/modules/addons/XPIProviderUtils.js:1173 processFileChanges()@resource://gre/modules/addons/XPIProvider.jsm -> resource://gre/modules/addons/XPIProviderUtils.js:1529 checkForChanges()@resource://gre/modules/addons/XPIProvider.jsm:3304 startup()@resource://gre/modules/addons/XPIProvider.jsm:2196 callProvider()@resource://gre/modules/AddonManager.jsm:253 _startProvider()@resource://gre/modules/AddonManager.jsm:728 startup()@resource://gre/modules/AddonManager.jsm:892 startup()@resource://gre/modules/AddonManager.jsm:2976 observe()@jar:file:///usr/lib64/firefox/omni.ja!/components/addonManager.js:63 1564387008469 addons.xpi-utils WARN Could not uninstall invalid item from locked install location Gtk-Message: 00:56:49.492: Failed to load module "canberra-gtk-module" Gtk-Message: 00:56:49.492: Failed to load module "pk-gtk-module" Gtk-Message: 00:56:49.500: Failed to load module "canberra-gtk-module" Gtk-Message: 00:56:49.500: Failed to load module "pk-gtk-module" 1564387010301 addons.xpi WARN Can't get modified time of /usr/lib64/firefox/browser/features/aushelper@mozilla.org.xpi 1564387010519 Marionette INFO Listening on port 45173 1564387010588 Marionette WARN TLS certificate errors will be ignored for this session [2019-07-29 00:56:50.708 -07:00] [INFO] Detected dialect: W3C [2019-07-29 00:56:50.725 -07:00] [INFO] Initial window size: system default [2019-07-29 00:56:50.725 -07:00] [INFO] Initialized: FirefoxDriver [2019-07-29 00:56:50.777 -07:00] [INFO] Timeout: 30000 ms [2019-07-29 00:56:50.778 -07:00] [INFO] Max retries: 0 Gtk-Message: 00:56:50.866: Failed to load module "canberra-gtk-module" Gtk-Message: 00:56:50.866: Failed to load module "pk-gtk-module" Gtk-Message: 00:56:50.868: Failed to load module "canberra-gtk-module" Gtk-Message: 00:56:50.869: Failed to load module "pk-gtk-module" [2019-07-29 00:56:51.254 -07:00] [INFO] Start: TestProject[loop] (/root/abdtest.side) [2019-07-29 00:56:51.273 -07:00] [INFO] Existing driver found. [2019-07-29 00:56:51.328 -07:00] [INFO] Current speed: 0 ms/command [2019-07-29 00:56:51.328 -07:00] [INFO] Start: TestSuite[Default Suite] (/root/abdtest.side) [2019-07-29 00:56:51.338 -07:00] [INFO] Existing driver found. [2019-07-29 00:56:51.353 -07:00] [INFO] Current speed: 0 ms/command [2019-07-29 00:56:51.354 -07:00] [INFO] Start: TestCase[abdtest] (/root/abdtest.side) [2019-07-29 00:56:51.354 -07:00] [INFO] baseURL: https://kva.se [2019-07-29 00:56:51.362 -07:00] [INFO] <1> Command#1: open("") [2019-07-29 00:57:05.864 -07:00] [INFO] - [Success] URL: [https://kva.se/sv/startsida] / Title: [Kungl. Vetenskapsakademien] [2019-07-29 00:57:05.866 -07:00] [INFO] - Cookie: atuvc=[1%7C31] (domain=kva.se, path=/, expire=2020-08-29 00:56:53 -07:00) [2019-07-29 00:57:05.866 -07:00] [INFO] - Cookie: atuvs=[5d3ea6c4ce318cce000] (domain=kva.se, path=/, expire=2019-07-29 01:26:53 -07:00) [2019-07-29 00:57:05.866 -07:00] [INFO] - Cookie: _ga=[GA1.2.1882394195.1564387014] (domain=.kva.se, path=/, expire=2021-07-28 00:56:53 -07:00) [2019-07-29 00:57:05.867 -07:00] [INFO] - Cookie: _gat=[1] (domain=.kva.se, path=/, expire=2019-07-29 00:57:53 -07:00) [2019-07-29 00:57:05.867 -07:00] [INFO] - Cookie: _gid=[GA1.2.1414456910.1564387014] (domain=.kva.se, path=/, expire=2019-07-30 00:56:53 -07:00) [2019-07-29 00:57:05.867 -07:00] [INFO] - Cookie: language=[sv] (domain=kva.se, path=/, expire=) [2019-07-29 00:57:05.867 -07:00] [INFO] - Cookie: wrongurl=[/] (domain=kva.se, path=/, expire=) [2019-07-29 00:57:05.868 -07:00] [INFO] <2> Command#2: executeScript("var imgs = []; var ie = document.getElementsByTagName('img'); for (var i = 0; i < ie.length; i++) { if (ie[i].currentSrc.includes('https://s3.eu-de.cloud-object-storage.appdomain.cloud/') ) imgs.push(ie[i].currentSrc); } return imgs;", "imgs") [2019-07-29 00:57:05.916 -07:00] [INFO] - [https://s3.eu-de.cloud-object-storage.appdomain.cloud/kva-image-pdf/2018/05/almedalen_2018_starpuff.jpg,https://s3.eu-de.cloud-object-storage.appdomain.cloud/kva-image-pdf/2019/06/strut_250.jpg,https://s3.eu-de.cloud-object-storage.appdomain.cloud/kva-image-pdf/2019/06/EASAC-Climate-health_250.jpg,https://s3.eu-de.cloud-object-storage.appdomain.cloud/kva-image-pdf/2019/07/Almedalen-seminarie200pxl.jpg,https://s3.eu-de.cloud-object-storage.appdomain.cloud/kva-image-pdf/2019/06/CollageAlmedalen200x200.jpg] [2019-07-29 00:57:05.916 -07:00] [INFO] <3> Command#3: executeScript("return 0;", "i") [2019-07-29 00:57:05.945 -07:00] [INFO] - [0] [2019-07-29 00:57:05.947 -07:00] [INFO] <4-1> Command#4: while("${i} < ${imgs}.length", "") [2019-07-29 00:57:05.973 -07:00] [INFO] - [Continue (count=1)] [2019-07-29 00:57:05.974 -07:00] [INFO] <4-2> Command#5: executeScript("return ${imgs}[${i}];", "img") [2019-07-29 00:57:05.998 -07:00] [INFO] - [https://s3.eu-de.cloud-object-storage.appdomain.cloud/kva-image-pdf/2018/05/almedalen_2018_starpuff.jpg] [2019-07-29 00:57:05.998 -07:00] [INFO] <4-3> Command#6: open("${img}") [2019-07-29 00:57:06.580 -07:00] [INFO] - [Success] URL: [https://s3.eu-de.cloud-object-storage.appdomain.cloud/kva-image-pdf/2018/05/almedalen_2018_starpuff.jpg] / Title: [almedalen_2018_starpuff.jpg (JPEG Image, 640 × 360 pixels)] [2019-07-29 00:57:06.581 -07:00] [INFO] <4-4> Command#7: assertElementPresent("xpath=//img") [2019-07-29 00:57:06.689 -07:00] [INFO] - [Success] [2019-07-29 00:57:06.690 -07:00] [INFO] <4-5> Command#8: executeScript("return ${i} + 1;", "i") [2019-07-29 00:57:06.708 -07:00] [INFO] - [1] [2019-07-29 00:57:06.709 -07:00] [INFO] <4-6> Command#9: echo("${i}") [2019-07-29 00:57:06.719 -07:00] [INFO] - [1] [2019-07-29 00:57:06.720 -07:00] [INFO] <4-7> Command#10: end() [2019-07-29 00:57:06.728 -07:00] [INFO] - [Go to next loop (#4)] [2019-07-29 00:57:06.729 -07:00] [INFO] <5-1> Command#4: while("${i} < ${imgs}.length", "") [2019-07-29 00:57:06.749 -07:00] [INFO] - [Continue (count=2)] [2019-07-29 00:57:06.749 -07:00] [INFO] <5-2> Command#5: executeScript("return ${imgs}[${i}];", "img") [2019-07-29 00:57:06.775 -07:00] [INFO] - [https://s3.eu-de.cloud-object-storage.appdomain.cloud/kva-image-pdf/2019/06/strut_250.jpg] [2019-07-29 00:57:06.776 -07:00] [INFO] <5-3> Command#6: open("${img}") [2019-07-29 00:57:07.589 -07:00] [INFO] - [Success] URL: [https://s3.eu-de.cloud-object-storage.appdomain.cloud/kva-image-pdf/2019/06/strut_250.jpg] / Title: [strut_250.jpg (JPEG Image, 250 × 250 pixels)] [2019-07-29 00:57:07.590 -07:00] [INFO] <5-4> Command#7: assertElementPresent("xpath=//img") [2019-07-29 00:57:07.609 -07:00] [INFO] - [Success] [2019-07-29 00:57:07.609 -07:00] [INFO] <5-5> Command#8: executeScript("return ${i} + 1;", "i") [2019-07-29 00:57:07.624 -07:00] [INFO] - [2] [2019-07-29 00:57:07.625 -07:00] [INFO] <5-6> Command#9: echo("${i}") [2019-07-29 00:57:07.632 -07:00] [INFO] - [2] [2019-07-29 00:57:07.633 -07:00] [INFO] <5-7> Command#10: end() [2019-07-29 00:57:07.640 -07:00] [INFO] - [Go to next loop (#4)] [2019-07-29 00:57:07.640 -07:00] [INFO] <6-1> Command#4: while("${i} < ${imgs}.length", "") [2019-07-29 00:57:07.658 -07:00] [INFO] - [Continue (count=3)] [2019-07-29 00:57:07.659 -07:00] [INFO] <6-2> Command#5: executeScript("return ${imgs}[${i}];", "img") [2019-07-29 00:57:07.674 -07:00] [INFO] - [https://s3.eu-de.cloud-object-storage.appdomain.cloud/kva-image-pdf/2019/06/EASAC-Climate-health_250.jpg] [2019-07-29 00:57:07.674 -07:00] [INFO] <6-3> Command#6: open("${img}") [2019-07-29 00:57:07.782 -07:00] [INFO] - [Success] URL: [https://s3.eu-de.cloud-object-storage.appdomain.cloud/kva-image-pdf/2019/06/EASAC-Climate-health_250.jpg] / Title: [EASAC-Climate-health_250.jpg (JPEG Image, 250 × 250 pixels)] [2019-07-29 00:57:07.782 -07:00] [INFO] <6-4> Command#7: assertElementPresent("xpath=//img") [2019-07-29 00:57:07.805 -07:00] [INFO] - [Success] [2019-07-29 00:57:07.806 -07:00] [INFO] <6-5> Command#8: executeScript("return ${i} + 1;", "i") [2019-07-29 00:57:07.827 -07:00] [INFO] - [3] [2019-07-29 00:57:07.827 -07:00] [INFO] <6-6> Command#9: echo("${i}") [2019-07-29 00:57:07.840 -07:00] [INFO] - [3] [2019-07-29 00:57:07.840 -07:00] [INFO] <6-7> Command#10: end() [2019-07-29 00:57:07.854 -07:00] [INFO] - [Go to next loop (#4)] [2019-07-29 00:57:07.854 -07:00] [INFO] <7-1> Command#4: while("${i} < ${imgs}.length", "") [2019-07-29 00:57:07.872 -07:00] [INFO] - [Continue (count=4)] [2019-07-29 00:57:07.873 -07:00] [INFO] <7-2> Command#5: executeScript("return ${imgs}[${i}];", "img") [2019-07-29 00:57:07.888 -07:00] [INFO] - [https://s3.eu-de.cloud-object-storage.appdomain.cloud/kva-image-pdf/2019/07/Almedalen-seminarie200pxl.jpg] [2019-07-29 00:57:07.889 -07:00] [INFO] <7-3> Command#6: open("${img}") [2019-07-29 00:57:07.995 -07:00] [INFO] - [Success] URL: [https://s3.eu-de.cloud-object-storage.appdomain.cloud/kva-image-pdf/2019/07/Almedalen-seminarie200pxl.jpg] / Title: [Almedalen-seminarie200pxl.jpg (JPEG Image, 200 × 200 pixels)] [2019-07-29 00:57:07.995 -07:00] [INFO] <7-4> Command#7: assertElementPresent("xpath=//img") [2019-07-29 00:57:08.021 -07:00] [INFO] - [Success] [2019-07-29 00:57:08.021 -07:00] [INFO] <7-5> Command#8: executeScript("return ${i} + 1;", "i") [2019-07-29 00:57:08.039 -07:00] [INFO] - [4] [2019-07-29 00:57:08.039 -07:00] [INFO] <7-6> Command#9: echo("${i}") [2019-07-29 00:57:08.047 -07:00] [INFO] - [4] [2019-07-29 00:57:08.047 -07:00] [INFO] <7-7> Command#10: end() [2019-07-29 00:57:08.060 -07:00] [INFO] - [Go to next loop (#4)] [2019-07-29 00:57:08.061 -07:00] [INFO] <8-1> Command#4: while("${i} < ${imgs}.length", "") [2019-07-29 00:57:08.077 -07:00] [INFO] - [Continue (count=5)] [2019-07-29 00:57:08.078 -07:00] [INFO] <8-2> Command#5: executeScript("return ${imgs}[${i}];", "img") [2019-07-29 00:57:08.097 -07:00] [INFO] - [https://s3.eu-de.cloud-object-storage.appdomain.cloud/kva-image-pdf/2019/06/CollageAlmedalen200x200.jpg] [2019-07-29 00:57:08.097 -07:00] [INFO] <8-3> Command#6: open("${img}") [2019-07-29 00:57:08.187 -07:00] [INFO] - [Success] URL: [https://s3.eu-de.cloud-object-storage.appdomain.cloud/kva-image-pdf/2019/06/CollageAlmedalen200x200.jpg] / Title: [CollageAlmedalen200x200.jpg (JPEG Image, 200 × 200 pixels)] [2019-07-29 00:57:08.188 -07:00] [INFO] <8-4> Command#7: assertElementPresent("xpath=//img") [2019-07-29 00:57:08.209 -07:00] [INFO] - [Success] [2019-07-29 00:57:08.209 -07:00] [INFO] <8-5> Command#8: executeScript("return ${i} + 1;", "i") [2019-07-29 00:57:08.224 -07:00] [INFO] - [5] [2019-07-29 00:57:08.224 -07:00] [INFO] <8-6> Command#9: echo("${i}") [2019-07-29 00:57:08.231 -07:00] [INFO] - [5] [2019-07-29 00:57:08.231 -07:00] [INFO] <8-7> Command#10: end() [2019-07-29 00:57:08.238 -07:00] [INFO] - [Go to next loop (#4)] [2019-07-29 00:57:08.239 -07:00] [INFO] <9-1> Command#4: while("${i} < ${imgs}.length", "") [2019-07-29 00:57:08.258 -07:00] [INFO] - [Break] [2019-07-29 00:57:08.259 -07:00] [INFO] <9-2> Command#10: end() [2019-07-29 00:57:08.266 -07:00] [INFO] - [Exit loop (#4)] [2019-07-29 00:57:08.271 -07:00] [INFO] End(16.913sec): TestCase[abdtest] (/root/abdtest.side) [2019-07-29 00:57:08.272 -07:00] [INFO] End(0.000sec): TestSuite[Default Suite] (/root/abdtest.side) [2019-07-29 00:57:08.272 -07:00] [INFO] End(0.000sec): TestProject[loop] (/root/abdtest.side) console.log: Accessibility service init or shutdown observer does not exist. *** UTM:SVC TimerManager:registerTimer called after profile-before-change notification. Ignoring timer registration for id: telemetry_modules_ping [2019-07-29 00:57:09.108 -07:00] [INFO] Quit: FirefoxDriver [2019-07-29 00:57:09.109 -07:00] [INFO] Exit code: 0 (SUCCESS)