vmi / selenese-runner-java

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

"For each" is not supported on selenese but it can work on IDE #305

Closed JackJiaJJ closed 5 years ago

JackJiaJJ commented 5 years ago

"For each" is not supported on selenese but it can work on IDE

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

I got below error:

"additionalDetails":"Error: InvalidSeleneseException - jp.vmi.selenium.selenese.SeleneseRunnerRuntimeException: No such command: forEach]",

vmi commented 5 years ago

Hi,

I have released 3.25.0 with the following command added:

Please test it.

JackJiaJJ commented 5 years ago

I just try the "for each" with selenese 3.25.0, it can work well

[root@apm-agent-0021 selenese-3.25.0]# java -jar selenese-runner.jar --driver firefox /root/IBMCLOUDFOREACH.side [2019-08-01 22:42:41.119 -07:00] [INFO] Start: Selenese Runner 3.25.0 [2019-08-01 22:42:41.543 -07:00] [INFO] No capabilities. 1564724562075 mozrunner::runner INFO Running command: "/usr/bin/firefox" "-marionette" "-foreground" "-no-remote" "-profile" "/tmp/rust_mozprofile.3eSu8ilue7M0" Gtk-Message: 22:42:42.183: Failed to load module "canberra-gtk-module" Gtk-Message: 22:42:42.183: Failed to load module "pk-gtk-module" Gtk-Message: 22:42:42.186: Failed to load module "canberra-gtk-module" Gtk-Message: 22:42:42.186: Failed to load module "pk-gtk-module" Gtk-Message: 22:42:43.334: Failed to load module "canberra-gtk-module" Gtk-Message: 22:42:43.334: Failed to load module "pk-gtk-module" Gtk-Message: 22:42:43.337: Failed to load module "canberra-gtk-module" Gtk-Message: 22:42:43.337: Failed to load module "pk-gtk-module" 1564724564357 Marionette INFO Listening on port 45071 1564724564403 Marionette WARN TLS certificate errors will be ignored for this session [2019-08-01 22:42:44.511 -07:00] [INFO] Detected dialect: W3C [2019-08-01 22:42:44.532 -07:00] [INFO] Initial window size: system default [2019-08-01 22:42:44.533 -07:00] [INFO] Initialized: FirefoxDriver [2019-08-01 22:42:44.579 -07:00] [INFO] Timeout: 30000 ms [2019-08-01 22:42:44.579 -07:00] [INFO] Max retries: 0 Gtk-Message: 22:42:44.713: Failed to load module "canberra-gtk-module" Gtk-Message: 22:42:44.713: Failed to load module "pk-gtk-module" Gtk-Message: 22:42:44.716: Failed to load module "canberra-gtk-module" Gtk-Message: 22:42:44.717: Failed to load module "pk-gtk-module" [2019-08-01 22:42:45.006 -07:00] [INFO] Start: TestProject[KVATests] (/root/IBMCLOUDFOREACH.side) [2019-08-01 22:42:45.019 -07:00] [INFO] Existing driver found. [2019-08-01 22:42:45.031 -07:00] [INFO] Current speed: 0 ms/command [2019-08-01 22:42:45.031 -07:00] [INFO] Start: TestSuite[Default Suite] (/root/IBMCLOUDFOREACH.side) [2019-08-01 22:42:45.046 -07:00] [INFO] Existing driver found. [2019-08-01 22:42:45.057 -07:00] [INFO] Current speed: 0 ms/command [2019-08-01 22:42:45.057 -07:00] [INFO] Start: TestCase[Check COS in start page] (/root/IBMCLOUDFOREACH.side) [2019-08-01 22:42:45.057 -07:00] [INFO] baseURL: https://demokva.eu-gb.mybluemix.net [2019-08-01 22:42:45.065 -07:00] [INFO] <1> Command#1: open("") [2019-08-01 22:43:03.942 -07:00] [INFO] - [Success] URL: [https://demokva.eu-gb.mybluemix.net/sv/startsida] / Title: [Kungl. Vetenskapsakademien] [2019-08-01 22:43:03.943 -07:00] [INFO] - Cookie: atuvc=[1%7C31] (domain=demokva.eu-gb.mybluemix.net, path=/, expire=2020-09-01 22:42:46 -07:00) [2019-08-01 22:43:03.944 -07:00] [INFO] - Cookie: atuvs=[5d43cd5661438e3f000] (domain=demokva.eu-gb.mybluemix.net, path=/, expire=2019-08-01 23:12:46 -07:00) [2019-08-01 22:43:03.944 -07:00] [INFO] - Cookie: _ga=[GA1.2.1424438416.1564724568] (domain=.mybluemix.net, path=/, expire=2021-07-31 22:42:47 -07:00) [2019-08-01 22:43:03.944 -07:00] [INFO] - Cookie: _gat=[1] (domain=.mybluemix.net, path=/, expire=2019-08-01 22:43:47 -07:00) [2019-08-01 22:43:03.944 -07:00] [INFO] - Cookie: _gid=[GA1.2.1424429025.1564724568] (domain=.mybluemix.net, path=/, expire=2019-08-02 22:42:47 -07:00) [2019-08-01 22:43:03.944 -07:00] [INFO] - Cookie: language=[sv] (domain=demokva.eu-gb.mybluemix.net, path=/, expire=) [2019-08-01 22:43:03.944 -07:00] [INFO] - Cookie: wrongurl=[/] (domain=demokva.eu-gb.mybluemix.net, path=/, expire=) [2019-08-01 22:43:03.945 -07:00] [INFO] <2> Command#2: executeScript("var srcs = [];var imgs = document.getElementsByTagName('img'); for (var i = 0; i < imgs.length; i++) { var src = imgs[i].currentSrc; var bucketImage = src.includes('https://s3.eu-de.cloud-object-storage.appdomain.cloud/'); if (bucketImage) srcs.push(src); }; return srcs;", "srcs") [2019-08-01 22:43:03.991 -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-08-01 22:43:03.991 -07:00] [INFO] <3> Command#3: echo("${srcs}") [2019-08-01 22:43:04.010 -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-08-01 22:43:04.010 -07:00] [INFO] <4-1> Command#4: forEach("srcs", "iterator") [2019-08-01 22:43:04.030 -07:00] [INFO] - [Continue (1/5: iterator=https://s3.eu-de.cloud-object-storage.appdomain.cloud/kva-image-pdf/2018/05/almedalen_2018_starpuff.jpg)] [2019-08-01 22:43:04.030 -07:00] [INFO] <4-2> Command#5: open("${iterator}") [2019-08-01 22:43:04.240 -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-08-01 22:43:04.241 -07:00] [INFO] <4-3> Command#6: assertElementPresent("xpath=//img") [2019-08-01 22:43:04.282 -07:00] [INFO] - [Success] [2019-08-01 22:43:04.282 -07:00] [INFO] <4-4> Command#7: end() [2019-08-01 22:43:04.294 -07:00] [INFO] - [Go to next loop (#4)] [2019-08-01 22:43:04.294 -07:00] [INFO] <5-1> Command#4: forEach("srcs", "iterator") [2019-08-01 22:43:04.304 -07:00] [INFO] - [Continue (2/5: iterator=https://s3.eu-de.cloud-object-storage.appdomain.cloud/kva-image-pdf/2019/06/strut_250.jpg)] [2019-08-01 22:43:04.304 -07:00] [INFO] <5-2> Command#5: open("${iterator}") [2019-08-01 22:43:04.395 -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-08-01 22:43:04.396 -07:00] [INFO] <5-3> Command#6: assertElementPresent("xpath=//img") [2019-08-01 22:43:04.429 -07:00] [INFO] - [Success] [2019-08-01 22:43:04.429 -07:00] [INFO] <5-4> Command#7: end() [2019-08-01 22:43:04.441 -07:00] [INFO] - [Go to next loop (#4)] [2019-08-01 22:43:04.442 -07:00] [INFO] <6-1> Command#4: forEach("srcs", "iterator") [2019-08-01 22:43:04.454 -07:00] [INFO] - [Continue (3/5: iterator=https://s3.eu-de.cloud-object-storage.appdomain.cloud/kva-image-pdf/2019/06/EASAC-Climate-health_250.jpg)] [2019-08-01 22:43:04.454 -07:00] [INFO] <6-2> Command#5: open("${iterator}") [2019-08-01 22:43:04.553 -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-08-01 22:43:04.554 -07:00] [INFO] <6-3> Command#6: assertElementPresent("xpath=//img") [2019-08-01 22:43:04.581 -07:00] [INFO] - [Success] [2019-08-01 22:43:04.581 -07:00] [INFO] <6-4> Command#7: end() [2019-08-01 22:43:04.589 -07:00] [INFO] - [Go to next loop (#4)] [2019-08-01 22:43:04.589 -07:00] [INFO] <7-1> Command#4: forEach("srcs", "iterator") [2019-08-01 22:43:04.602 -07:00] [INFO] - [Continue (4/5: iterator=https://s3.eu-de.cloud-object-storage.appdomain.cloud/kva-image-pdf/2019/07/Almedalen-seminarie200pxl.jpg)] [2019-08-01 22:43:04.602 -07:00] [INFO] <7-2> Command#5: open("${iterator}") [2019-08-01 22:43:04.685 -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-08-01 22:43:04.686 -07:00] [INFO] <7-3> Command#6: assertElementPresent("xpath=//img") [2019-08-01 22:43:04.715 -07:00] [INFO] - [Success] [2019-08-01 22:43:04.715 -07:00] [INFO] <7-4> Command#7: end() [2019-08-01 22:43:04.724 -07:00] [INFO] - [Go to next loop (#4)] [2019-08-01 22:43:04.724 -07:00] [INFO] <8-1> Command#4: forEach("srcs", "iterator") [2019-08-01 22:43:04.736 -07:00] [INFO] - [Continue (5/5: iterator=https://s3.eu-de.cloud-object-storage.appdomain.cloud/kva-image-pdf/2019/06/CollageAlmedalen200x200.jpg)] [2019-08-01 22:43:04.736 -07:00] [INFO] <8-2> Command#5: open("${iterator}") [2019-08-01 22:43:04.804 -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-08-01 22:43:04.805 -07:00] [INFO] <8-3> Command#6: assertElementPresent("xpath=//img") [2019-08-01 22:43:04.838 -07:00] [INFO] - [Success] [2019-08-01 22:43:04.839 -07:00] [INFO] <8-4> Command#7: end() [2019-08-01 22:43:04.845 -07:00] [INFO] - [Exit loop (#4)] [2019-08-01 22:43:04.846 -07:00] [INFO] End(19.788sec): TestCase[Check COS in start page] (/root/IBMCLOUDFOREACH.side) [2019-08-01 22:43:04.847 -07:00] [INFO] End(0.000sec): TestSuite[Default Suite] (/root/IBMCLOUDFOREACH.side) [2019-08-01 22:43:04.847 -07:00] [INFO] End(0.000sec): TestProject[KVATests] (/root/IBMCLOUDFOREACH.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-08-01 22:43:05.670 -07:00] [INFO] Quit: FirefoxDriver [2019-08-01 22:43:05.670 -07:00] [INFO] Exit code: 0 (SUCCESS)